Easy Shadcn
Components

Accordion

Accordion flattens shadcn's Accordion compound components into a single items-driven component: each item describes its trigger and panel content, instead of hand-writing nested AccordionItem / AccordionTrigger / AccordionContent structures.

Orders ship within 1–2 business days and arrive in 3–5 days.

Multiple panels stay open at once with the multiple prop.

Push to main and CI publishes the registry automatically.

Installation

With the @easy-shadcn namespace configured:

pnpm dlx shadcn@latest add @easy-shadcn/accordion

Or install via the full URL (zero configuration):

pnpm dlx shadcn@latest add https://easy-shadcn.vercel.app/r/accordion.json

Props

PropTypeDefaultDescription
itemsAccordionItem[]-Item definitions — see the table below. An empty array renders an empty accordion.
valuestring[]-The open item values. Use for the controlled mode.
defaultValuestring[]-The initially open item values. Use for the uncontrolled mode.
onValueChange(value: string[], eventDetails) => void-Called when an item is expanded or collapsed.
multiplebooleanfalseAllows multiple panels to stay open at the same time.
disabledbooleanfalseDisables every item.
keepMountedbooleanfalseKeeps closed panels mounted (hidden) instead of unmounting them.
itemClassNameClassValue-Class override applied to every AccordionItem.
triggerClassNameClassValue-Class override applied to every AccordionTrigger.
contentClassNameClassValue-Class override applied to every AccordionContent.

All other props (className, orientation, loopFocus, etc.) are forwarded to the underlying Accordion root.

AccordionItem

FieldTypeDescription
valuestringUnique identifier of the item.
triggerReactNodeHeader content — plain text or e.g. icon + text.
contentReactNodePanel content.
disabledbooleanDisables this item.
itemClassNameClassValuePer-item class, merged after the root-level itemClassName.
triggerClassNameClassValuePer-item trigger class, merged after the root-level triggerClassName.
contentClassNameClassValuePer-item content class, merged after the root-level contentClassName.

Notes

  • value / defaultValue are arrays because Base UI's accordion is multi-open at heart. In single mode (multiple omitted) the array holds at most one value.
  • value / defaultValue / onValueChange are narrowed to string[] — the Base UI primitive accepts any[], which silently swallows typos.
  • Use keepMounted when a panel holds expensive state (forms, iframes) that should survive collapsing.
  • items must be homogeneous. For heterogeneous triggers or panels (custom chevrons, non-uniform layouts), compose the components/ui/accordion primitives directly instead.

On this page