npx skills add ...
npx skills add heroui-inc/heroui --skill heroui-react
HeroUI v3 React component library (Tailwind CSS v4 + React Aria). Use when building UIs with HeroUI — creating Buttons, Modals, Forms, Cards; installing @heroui/react; configuring dark/light themes with oklch variables; or fetching component docs. Keywords: HeroUI, Hero UI, heroui, @heroui/react, @heroui/styles.
npx skills add heroui-inc/heroui --skill heroui-react
HeroUI v3 is a component library built on Tailwind CSS v4 and React Aria Components, providing accessible, customizable UI components for React applications.
This guide is for HeroUI v3 ONLY. Do NOT apply v2 patterns — the provider, styling, and component API all changed:
| Feature | v2 (DO NOT USE) | v3 (USE THIS) |
|---|---|---|
| Provider | <HeroUIProvider> required | No Provider needed |
| Animations | framer-motion package | CSS-based, no extra deps |
| Component API | Flat props: <Card title="x"> | Compound: <Card><Card.Header> |
| Styling | Tailwind v3 + @heroui/theme | Tailwind v4 + @heroui/styles |
| Packages | @heroui/system, @heroui/theme | @heroui/react, @heroui/styles |
Always fetch v3 docs before implementing.
primary, secondary, tertiary) over visual descriptionsoklch color spaceFor component details, examples, props, and implementation patterns, always fetch documentation:
Component docs: fetch .mdx with a concrete kebab-case slug. Run node scripts/list_components.mjs when the slug is unknown, and never fetch a URL that still contains a placeholder.
Examples:
https://heroui.com/docs/react/components/button.mdxhttps://heroui.com/docs/react/components/modal.mdxhttps://heroui.com/docs/react/components/form.mdxGetting started guides: use a concrete topic URL such as https://heroui.com/docs/react/getting-started/quick-start.mdx.
Important: Always fetch component docs before implementing. The MDX docs include complete examples, props, anatomy, and API references.
app/globals.css:app/layout.tsx:postcss.config.mjs):Card.Header, Card.Content)onPress event handlersAll components use the compound pattern shown above (dot-notation subcomponents like Card.Header, Card.Content). Don't flatten to props — always compose with subcomponents. Fetch component docs for complete anatomy and examples.
HeroUI uses semantic naming to communicate functional intent:
| Variant | Purpose | Usage |
|---|---|---|
primary | Main action to move forward | 1 per context |
secondary | Alternative actions | Multiple |
tertiary | Dismissive actions (cancel, skip) | Sparingly |
danger | Destructive actions | When needed |
ghost | Low-emphasis actions | Minimal weight |
outline | Secondary actions | Bordered style |
Don't use raw colors - semantic variants adapt to themes and accessibility.
HeroUI v3 uses CSS variables with oklch color space:
Get current theme variables:
Color naming:
--accent)-foreground = text color (e.g., --accent-foreground)Theme switching:
For detailed theming, fetch: https://heroui.com/docs/react/getting-started/theming.mdx
// DO THIS - v3 pattern (no provider, compound components)
import { Card } from "@heroui/react";
<Card>
<Card.Header>
<Card.Title>Product</Card.Title>
<Card.Description>A great product</Card.Description>
</Card.Header>
</Card>;# List all available components
node scripts/list_components.mjs
# Get component documentation (MDX)
node scripts/get_component_docs.mjs Button
node scripts/get_component_docs.mjs Button Card TextField
# Get component source code
node scripts/get_source.mjs Button
# Get component CSS styles (BEM classes)
node scripts/get_styles.mjs Button
# Get theme variables
node scripts/get_theme.mjs
# Get non-component docs (guides, releases)
node scripts/get_docs.mjs /docs/react/getting-started/themingnpm i @heroui/styles @heroui/react tailwind-variantsnpm i @heroui/styles @heroui/react tailwind-variants tailwindcss @tailwindcss/postcss postcss/* Tailwind CSS v4 - Must be first */
@import "tailwindcss";
/* HeroUI v3 styles - Must be after Tailwind */
@import "@heroui/styles";import "./globals.css";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<body>
{/* No Provider needed in HeroUI v3! */}
{children}
</body>
</html>
);
}export default {
plugins: {
"@tailwindcss/postcss": {},
},
};:root {
--accent: oklch(0.6204 0.195 253.83);
--accent-foreground: var(--snow);
--background: oklch(0.9702 0 0);
--foreground: var(--eclipse);
}node scripts/get_theme.mjs<html class="dark" data-theme="dark"></html>