# @twind/macro

> A babel macro for twind, adds support for tw prop in jsx

Latest version **2.1.1** (published 2021-08-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @twind/macro
pnpm add @twind/macro
yarn add @twind/macro
bun add @twind/macro
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-08-08 |
| First published | 2021-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | MapleLeaf |
| Maintainers | sastan, itsmapleleaf |
| Keywords | twind, tailwind, babel macro |

## Links

- npm: https://www.npmjs.com/package/@twind/macro
- Repository: https://github.com/tw-in-js/twind-jsx-preprocessor
- Homepage: https://github.com/tw-in-js/twind-jsx-preprocessor#readme
- Issues: https://github.com/tw-in-js/twind-jsx-preprocessor/issues
- npm.io page: https://npm.io/package/@twind/macro

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2.1.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.13.10
- [@types/react](https://npm.io/package/@types/react.md) ^17.0.3
- [babel-plugin-macros](https://npm.io/package/babel-plugin-macros.md) ^3.0.1
- [@twind/jsx-preprocessor](https://npm.io/package/@twind/jsx-preprocessor.md) ^2.1.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-08-08
- 2.1.0 — 2021-03-23
- 2.0.4 — 2021-03-13
- 2.0.3 — 2021-03-08
- 2.0.2 — 2021-03-08
- 2.0.1 — 2021-03-08
- 2.0.0 — 2021-03-08
- 1.0.1 — 2021-03-05
- 1.0.0 — 2021-03-05
- 0.1.4 — 2021-03-04
- 0.1.2 — 2021-01-16
- 0.1.1 — 2021-01-12

## README

# @twind/macro

A Babel macro which adds JSX enhancements for [Twind](https://github.com/tw-in-js/twind)

## [Features](../../README.md#features)

## Usage

1. Add [babel-plugin-macros](https://github.com/kentcdodds/babel-plugin-macros) to your Babel config (if you use Create React App, it's already installed!)

1. Install:

   ```
   npm install -D @twind/macro
   ```

1. Import to use:

   ```jsx
   import '@twind/macro'

   const Button = (props) => (
     <button tw="bg-green-600 text-green-100 p-3 hover:bg-green-700 rounded" {...props} />
   )
   ```

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