Index of every page on this site: llms.txt
All skills
heroui-inc avatar

/heroui-react

@4d13b2b
by HeroUIheroui-inc/heroui31k stars
2,242
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/heroui-inc/heroui/heroui-react

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈82 tokens for metadata: the name and description. ≈1.8k when used: this file.

Description uses 4.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈328 characters, or 4.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 oklch color space
  • BEM naming convention for predictable styling

Accessing Documentation & Component Information

For component details, examples, props, and implementation patterns, always fetch documentation:

Installed Docs First

@heroui/react ships its docs inside the package. When the project has it installed, they match the installed version, so read them before anything else:

  • node_modules/@heroui/react/docs/llms.txt — index: which page to read for a task, plus every component and guide
  • node_modules/@heroui/react/docs/components/<name>.md — one component (kebab-case, e.g. date-picker.md)
  • node_modules/@heroui/react/docs/guides/<name>.md — guides (theming.md, styling.md…)

The scripts below do this for you: get_component_docs.mjs and get_docs.mjs read the installed docs when they exist and fall back to the network (latest version) when they don't. Run them from inside the project.

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)

  1. Install dependencies:
npm i @heroui/styles @heroui/react tailwind-variants tailwindcss @tailwindcss/postcss postcss
  1. Create/update app/globals.css:
/* Tailwind CSS v4 - Must be first */
@import "tailwindcss";

/* HeroUI v3 styles - Must be after Tailwind */
@import "@heroui/styles";
  1. 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>
	);
}
  1. Configure PostCSS (postcss.config.mjs):
export default {
	plugins: {
		"@tailwindcss/postcss": {},
	},
};

Critical Setup Requirements

  1. Tailwind CSS v4 is MANDATORY - HeroUI v3 will NOT work with Tailwind CSS v3
  2. Use Compound Components - Components use compound structure (e.g., Card.Header, Card.Content)
  3. Use onPress, not onClick - For better accessibility, use onPress event handlers
  4. 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

Global customization and custom themes: to restyle components app-wide (tokens, BEM class overrides, new variants) or author a complete named light/dark theme, use the heroui-theming skill. If it is not installed:

curl -fsSL https://heroui.com/install | bash -s heroui-theming

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 alertstoday5 checks · Risk HIGH
  • Gen Agent Trust Hub1d

    The skill facilitates development with HeroUI v3 by fetching documentation and source code from official vendor sources. It includes a remote installation command from the vendor's domain. No malicious behavior was detected, though it presents a surface for indirect prompt injection from content fetched via the provided documentation scripts.

  • Sockettoday

    No alerts

  • Snyk1d

    Risk: CRITICAL · 2 issues

  • Runlayer8mo

    8 files scanned · No issues

  • ZeroLeaks7mo

    1 finding · Score: 82/100

Signed by skilld at 4d13b2b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 days ago
metadata
{
  "author": "heroui",
  "version": "3.0.1"
}
  • React
  • TypeScript
  • heroui
  • tailwind
  • component-library
  • accessible-components
  • theming
  • react-aria

README badge

README badge for heroui-inc/heroui/heroui-react

HeroUI v3 is a React component library built on Tailwind CSS v4 and React Aria, providing compound components like Card, Button, Modal, and Form with semantic variants and oklch-based theming. Use this skill when building UIs with @heroui/react, configuring dark/light themes, or implementing accessible components without a provider wrapper.

Generated from the current SKILL.md.

Does HeroUI v3 require a provider wrapper?
No. HeroUI v3 does not require `<HeroUIProvider>` — it works without a provider wrapper, unlike v2.
What version of Tailwind CSS does HeroUI v3 require?
Tailwind CSS v4 is mandatory. HeroUI v3 will not work with Tailwind CSS v3.
How do I structure HeroUI v3 components?
Use compound components with dot notation (e.g., `<Card><Card.Header><Card.Title>`) rather than flat props. Always fetch component docs for complete anatomy.
Should I use onClick or onPress for event handlers?
Use `onPress` instead of `onClick` for better accessibility with HeroUI components.
Can I use v2 patterns and examples with HeroUI v3?
No. v2 patterns (framer-motion animations, flat props, HeroUIProvider) do not apply to v3 and will break. Always fetch v3 documentation before implementing.

Generated from the current SKILL.md. These answers refresh after source changes.