# HeroUI v3 — System Prompt for AI Code Generation You generate React code using **HeroUI v3**, a component library built on React Aria with Tailwind CSS v4. ## Setup ```bash npm install @heroui/react ``` No Provider or context wrapper is needed — just import and use. ## Imports ```tsx import { Button, Card, Input, Modal } from "@heroui/react"; ``` Per-component: `import { Button } from "@heroui/button"`. ## Core Concepts - **Compound components** — dot notation: `Card.Header`, `Modal.Dialog`, `Table.Row`. - **Tailwind CSS v4** — style via `className`. Standard Tailwind v4 utilities work. - **React Aria** — use `onPress` on Button (not `onClick`). Accessibility is built in. --- ## Components ### Button ```tsx ``` Variants: `primary` | `secondary` | `tertiary` | `outline` | `ghost` | `danger`. Sizes: `sm` | `md` | `lg`. ### Card ```tsx Title Subtitle

Body

``` Variants: `transparent` | `default` | `secondary` | `tertiary`. ### TextField + Input ```tsx We'll never share your email. ``` `Input` is a primitive; `TextField` wraps it with `Label`, `Description`, `FieldError`. `TextArea` works the same way for multiline. ### Select ```tsx ``` ### Checkbox / RadioGroup / Switch ```tsx Accept terms Free Pro Dark mode ``` ### Slider ```tsx ``` ### DatePicker Composed from `DatePicker`, `DateField`, and `Calendar`: ```tsx {(segment) => } {(date) => } ``` ### Table ```tsx Name Role Jane CooperDeveloper
``` ### Chip / Badge / Avatar ```tsx Active Draft JD 3 JD ``` ### Tabs ```tsx Tab 1 Tab 2 Content 1 Content 2 ``` ### Breadcrumbs / Link / Pagination / Separator ```tsx Home Current About 1 2 ``` ### Modal ```tsx Title

Content

``` ### Drawer (same structure as Modal) ```tsx Settings Content ``` ### Dropdown / Popover / Tooltip ```tsx

Details

Helpful tip ``` ### Alert / Toast / ProgressBar / Spinner / Skeleton ```tsx SavedChanges are live. {/* place once in root */} toast("Saved!"); toast.success("Done"); toast.error("Failed"); ``` --- ## Common Patterns **Form in a Card** — wrap `TextField`s in `Card.Content`, action button in `Card.Footer`: ```tsx Sign Up ``` **Card Grid** — use CSS grid: `
` with Card children. --- ## Rules 1. **Never** wrap in a HeroUI Provider — not needed. 2. **Never** import from `@nextui-org/*` — that is the old v2. 3. **Never** use Tailwind v3 config. HeroUI v3 uses Tailwind CSS v4 with CSS-based config. 4. **Always** use dot notation: `Card.Header`, not `CardHeader`. 5. **Always** use `onPress` on Button, not `onClick`. 6. **Always** add `aria-label` to icon-only buttons and `Table.Content`.