Components
Loading preview...
HeroUI v3 Accordion — a collapsible content panel built with the real @heroui/react package. Default and surface variants, single or multiple expanded, controlled and default-expanded keys, custom indicator, disabled items, hidden separators, grouped FAQ layout and custom styles. Works in light and dark themes.
npx shadcn@latest add https://21st.dev/r/hero_ui/heroui-accordionimport { Accordion } from "@/components/ui/heroui-accordion"
const items = [
{ id: "getting-started", q: "Getting Started", a: "Learn the basics of HeroUI and how to integrate it into your React project. This section covers installation, setup, and your first component." },
{ id: "core-concepts", q: "Core Concepts", a: "Understand the core ideas behind HeroUI: variants, slots, theming tokens and accessibility built on React Aria." },
{ id: "advanced", q: "Advanced Usage", a: "Compose components, build custom variants, and integrate HeroUI with your design system." },
{ id: "best-practices", q: "Best Practices", a: "Follow recommended patterns for performance, accessibility, and maintainable component composition." },
]
export default function Multiple() {
return (
<div className="flex min-h-screen w-full items-center justify-center p-8">
<Accordion allowsMultipleExpanded className="w-full max-w-md">
{items.map((f) => (
<Accordion.Item key={f.id} id={f.id}>
<Accordion.Heading>
<Accordion.Trigger>
{f.q}
<Accordion.Indicator />
</Accordion.Trigger>
</Accordion.Heading>
<Accordion.Panel>
<Accordion.Body>{f.a}</Accordion.Body>
</Accordion.Panel>
</Accordion.Item>
))}
</Accordion>
</div>
)
}