Skip to content

Latest commit

 

History

History

README.md

@uswds-tailwind/react

Open on npmx.dev Open on npmx.dev Open on npmx.dev

USWDS components for React, styled with Tailwind CSS and powered by zag-js state machines.

Note

This package is in alpha. APIs may change between releases.

Open in StackBlitz

Install

npm install @uswds-tailwind/react@alpha tailwindcss

Setup

Add two @import lines to your global CSS:

/* style.css */
@import 'tailwindcss';
@import '@uswds-tailwind/react';

Usage

import { Button } from '@uswds-tailwind/react/button'

export default function App() {
  return <Button>Get started</Button>
}

Each component is also accessible from a subpath import (e.g. @uswds-tailwind/react/accordion) so bundlers can tree-shake unused components.

Documentation

Component API, props, and Storybook examples: uswds-tailwind.com

License

MIT