heroui-react
heroui-inc/heroui
Accessible React component library built on Tailwind CSS v4 and React Aria.
What is heroui-react?
HeroUI v3 is a component library providing pre-built, accessible UI components (Buttons, Modals, Forms, Cards) for React applications. Use it when building UIs with semantic variants, compound components, and CSS variable-based theming. Note: v3 requires Tailwind CSS v4 and does not need a provider wrapper.
- Create accessible UI components (Button, Modal, Form, Card, TextField, etc.) using compound component patterns
- Configure dark/light themes with oklch CSS variables and semantic color naming
- Use React Aria Components for built-in accessibility and keyboard navigation
- Style components with Tailwind CSS v4 and BEM naming conventions
- Fetch component documentation, source code, and theme variables via built-in scripts
How to install heroui-react
npx skills add https://github.com/heroui-inc/heroui --skill heroui-react- Node.js and npm installed
- Tailwind CSS v4 (v3 is not compatible with HeroUI v3)
- React 16.8+ (for hooks)
- PostCSS configured in your project
How to use heroui-react
- 1.Run npm i @heroui/styles @heroui/react tailwind-variants to install dependencies
- 2.Import Tailwind CSS v4 before HeroUI styles in your global CSS file (import order matters)
- 3.Remove any HeroUIProvider wrapper—v3 requires no provider
- 4.Use compound component syntax (e.g., Card.Header, Card.Content) instead of flat props
- 5.Use onPress instead of onClick for better accessibility
- 6.Run node scripts/list_components.mjs to see available components
- 7.Fetch component docs via node scripts/get_component_docs.mjs ComponentName before implementing
- 8.Use semantic variants (primary, secondary, tertiary, danger) instead of raw colors
Use cases
- Building a Next.js app with a complete design system using HeroUI components
- Creating accessible form layouts with compound Form, TextField, and Button components
- Implementing dark/light theme switching with oklch color variables
- Styling a modal dialog with Card, Button, and semantic variants for actions
- Customizing component appearance while maintaining accessibility standards
- React developers building accessible UIs
- Next.js app developers needing a component library
- Teams implementing design systems with semantic color variants
- Developers migrating from HeroUI v2 to v3
heroui-react FAQ
No. HeroUI v3 does not require a provider wrapper. Remove any HeroUIProvider from your code.
No. HeroUI v3 requires Tailwind CSS v4. It will not work with v3.
v3 uses compound components (e.g., Card.Header, Card.Content) instead of flat props. Always fetch the component docs via node scripts/get_component_docs.mjs to see the correct anatomy.
Add class="dark" or data-theme="dark" to the html element. Themes use oklch CSS variables that adapt automatically.
Use onPress for better accessibility with React Aria Components.
Full instructions (SKILL.md)
Source of truth, from heroui-inc/heroui.
name: heroui-react description: "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." metadata: author: heroui version: "3.0.1"
HeroUI v3 React Development Guide
HeroUI v3 is a component library built on Tailwind CSS v4 and React Aria Components, providing accessible, customizable UI components for React applications.
Installation
curl -fsSL https://heroui.com/install | bash -s heroui-react
CRITICAL: v3 Only - Ignore v2 Knowledge
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 |
// DO NOT DO THIS - v2 pattern
import { HeroUIProvider } from "@heroui/react";
import { motion } from "framer-motion";
<HeroUIProvider>
<Card title="Product" description="A great product" />
</HeroUIProvider>;
CORRECT (v3 patterns)
// 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>;
Always fetch v3 docs before implementing.
Core Principles
- Semantic variants (
primary,secondary,tertiary) over visual descriptions - Composition over configuration (compound components)
- CSS variable-based theming with
oklchcolor space - BEM naming convention for predictable styling
Accessing Documentation & Component Information
For component details, examples, props, and implementation patterns, always fetch documentation:
Using Scripts
# 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/theming
Direct MDX URLs
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:
- Button:
https://heroui.com/docs/react/components/button.mdx - Modal:
https://heroui.com/docs/react/components/modal.mdx - Form:
https://heroui.com/docs/react/components/form.mdx
Getting 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.
Installation Essentials
Quick Install
npm i @heroui/styles @heroui/react tailwind-variants
Framework Setup (Next.js App Router - Recommended)
- Install dependencies:
npm i @heroui/styles @heroui/react tailwind-variants tailwindcss @tailwindcss/postcss postcss
- Create/update
app/globals.css:
/* Tailwind CSS v4 - Must be first */
@import "tailwindcss";
/* HeroUI v3 styles - Must be after Tailwind */
@import "@heroui/styles";
- Import in
app/layout.tsx:
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>
);
}
- Configure PostCSS (
postcss.config.mjs):
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};
Critical Setup Requirements
- Tailwind CSS v4 is MANDATORY - HeroUI v3 will NOT work with Tailwind CSS v3
- Use Compound Components - Components use compound structure (e.g.,
Card.Header,Card.Content) - Use onPress, not onClick - For better accessibility, use
onPressevent handlers - Import Order Matters - Always import Tailwind CSS before HeroUI styles
Component Patterns
All 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.
Semantic Variants
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.
Theming
HeroUI v3 uses CSS variables with oklch color space:
:root {
--accent: oklch(0.6204 0.195 253.83);
--accent-foreground: var(--snow);
--background: oklch(0.9702 0 0);
--foreground: var(--eclipse);
}
Get current theme variables:
node scripts/get_theme.mjs
Color naming:
- Without suffix = background (e.g.,
--accent) - With
-foreground= text color (e.g.,--accent-foreground)
Theme switching:
<html class="dark" data-theme="dark"></html>
For detailed theming, fetch: https://heroui.com/docs/react/getting-started/theming.mdx
Related skills
More from heroui-inc/heroui and the wider catalog.

heroui-migration
Migrate HeroUI v2 apps to v3 with compound components, no Provider, and Tailwind v4.

heroui-native
React Native component library with Tailwind v4 (Uniwind) for accessible, customizable mobile UIs.

deep-productivity
Master deep work productivity through the three types of work framework (Building, Maintenance, Recovery). Use when user needs to: (1) Build a sustainable deep work routine with just 1 hour/day, (2) Create vision/anti-vision for life direction, (3) Structure goals using the 10-year → 1-year → 1-month → 1-week hierarchy, (4) Apply project-based learning to bridge skill gaps, (5) Identify lever-moving tasks that actually progress goals, (6) Balance focus work with necessary recovery for creativity.

seedance2-api
End-to-end AI video generation from storyboard to final output using Seedream 4.5 and Seedance 2.0

animejs
Anime.js adapter for deterministic, seek-driven animations in HyperFrames compositions.

canopy-part-title
Animated leaf-sweep reveal for headlines with customizable typography and particle effects.