# aesthetic-react

> React hooks, composers, and more for styling components with Aesthetic.

Latest version **2.2.1** (published 2020-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install aesthetic-react
pnpm add aesthetic-react
yarn add aesthetic-react
bun add aesthetic-react
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2020-04-07 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 35 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 207 |
| Maintainers | milesj |
| Keywords | aesthetic, react, styles, hook, hoc, composer |

## Links

- npm: https://www.npmjs.com/package/aesthetic-react
- Repository: https://github.com/milesj/aesthetic/tree/master/packages/react-legacy
- Funding: https://ko-fi.com/milesjohnson
- npm.io page: https://npm.io/package/aesthetic-react

## Dependencies (6)

- [uuid](https://npm.io/package/uuid.md) ^7.0.1
- [direction](https://npm.io/package/direction.md) ^1.0.4
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@types/react](https://npm.io/package/@types/react.md) *
- [aesthetic-utils](https://npm.io/package/aesthetic-utils.md) ^3.1.0
- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) ^3.3.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.2.1 (latest) — 2020-04-07
- 2.0.0-alpha.2 (next) — 2019-12-19
- 2.2.0 — 2020-04-06
- 2.1.3 — 2020-03-24
- 2.1.2 — 2020-03-02
- 2.1.1 — 2020-02-22
- 2.1.0 — 2020-01-27
- 2.0.1 — 2019-12-19
- 2.0.0 — 2019-12-19
- 2.0.0-alpha.1 — 2019-12-18
- 2.0.0-alpha.0 — 2019-12-17
- 1.1.3 — 2019-09-24
- 1.1.2 — 2019-09-16
- 1.1.1 — 2019-07-24
- 1.1.0 — 2019-07-12
- … 10 more at https://npm.io/package/aesthetic-react/versions

## README

# Aesthetic via React

[![Build Status](https://github.com/milesj/aesthetic/workflows/Build/badge.svg)](https://github.com/milesj/aesthetic/actions?query=branch%3Amaster)
[![npm version](https://badge.fury.io/js/aesthetic-react.svg)](https://www.npmjs.com/package/aesthetic-react)
[![npm deps](https://david-dm.org/milesj/aesthetic.svg?path=packages/react-legacy)](https://www.npmjs.com/package/aesthetic-react)

Style React components with hooks or HOCs, using the powerful
[Aesthetic](https://github.com/milesj/aesthetic) library.

```tsx
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](https://milesj.gitbook.io/aesthetic/integrations/react)

---
_Source: https://npm.io/package/aesthetic-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
