aesthetic-react
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published

Aesthetic via React

Build Status npm version npm deps

Style React components with hooks or HOCs, using the powerful Aesthetic library.

import React from 'react';
import { useStyles } from 'aesthetic-react';
 
export type Props = {
  children: React.ReactNode;
};
 
export default function Button({ children }: Props) {
  const [styles, cx] = useStyles(({ unit }) => ({
    button: {
      textAlign: 'center',
      display: 'inline-block',
      padding: unit,
    },
  }));
 
  return (
    <button type="button" className={cx(styles.button)}>
      {children}
    </button>
  );
}

Requirements

  • React 16.6+

Installation

yarn add aesthetic aesthetic-react react
// Or
npm install aesthetic aesthetic-react react

Documentation

https://milesj.gitbook.io/aesthetic/integrations/react

Package Sidebar

Install

npm i aesthetic-react

Weekly Downloads

114

Version

2.2.1

License

MIT

Unpacked Size

35.8 kB

Total Files

26

Last publish

Collaborators

  • milesj