1.2.1 • Published 1 year ago

@djgrant/react-tailwind v1.2.1

Weekly downloads
16
License
MIT
Repository
github
Last release
1 year ago

react-tailwind

Build React components using tailwindcss and a clean, functional API.

Inspired by styled-components and classnames.

import { tw, switchcase } from "@djgrant/react-tailwind";

const Button = tw.button((props) => [
  "font-semibold",
  "rounded",
  switchcase(size, {
    lg: ["text-base", "py-3", "px-4"],
    sm: ["text-xs", "py-1", "px-2"],
    default: ["text-sm", "py-2", "px-3"],
  }),
]);

<Button size="lg">Submit</Button>;

Install

npm install @djgrant/react-tailwind