heroui-react
Fungsinya
Skill ini memandu pembuatan antarmuka web dengan pustaka komponen HeroUI versi 3 untuk React. Skill mencakup instalasi, pengaturan tema, dan cara memakai struktur komponen gabungan.
Kapan dipakai
- βSaat Anda membangun halaman atau aplikasi web React dengan komponen HeroUI.
- βKetika Anda ingin mengatur tema terang dan gelap untuk proyek web HeroUI.
- βSaat Anda membutuhkan dokumentasi untuk komponen HeroUI, seperti modal atau formulir.
Link skill
https://github.com/heroui-inc/heroui/blob/v3/skills/heroui-react/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBangun halaman formulir kontak di React dengan komponen HeroUI v3, dan sertakan opsi mode gelap.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent membaca dokumentasi versi 3 terlebih dahulu, karena pola versi 2 yang lebih lama tidak lagi berlaku. Agent memasang pustaka, mengatur tema, dan menulis komponen dengan struktur gabungan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
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 o
Pertanyaan umum
Apakah saya perlu pembungkus provider?
Tidak. Versi 3 tidak memerlukan komponen provider.
Bagaimana kartu disusun?
Kartu dibangun dari bagian-bagian seperti header, misalnya dengan pembungkus Card dan bagian Card.Header.
Apakah memakai Tailwind CSS?
Ya. Skill memakai Tailwind versi 4 dengan paket gaya HeroUI.
Detail
Deskripsi asli dari pembuat
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.
repo: heroui-inc/heroui
Popularitas
- Bintang GitHub
- 31k
- Peringkat
- #9327
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
heroui-migration
31kMembantu agent Anda meningkatkan aplikasi web HeroUI v2 ke HeroUI v3, termasuk pola komponen yang berubah dan hook yang dihapus.
heroui-native
31kMembantu agent Anda membangun layar aplikasi mobile dengan komponen HeroUI Native, seperti tombol, kartu, dan dialog.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.