ui-kit0.0

Display

Accordion

Reveal sections in place.

Usage

An accordion is a stack of headings that each reveal a region. Height animates on the smooth spring and follows the content, with nothing measured in JavaScript. type="single" keeps one item open; type="multiple" allows any number.

Yes. Upgrades apply immediately and downgrades start at the next billing date. We prorate the difference.

When to use

  • Content that people scan and open selectively: FAQs, settings groups, filters.
  • Use Collapsible for a single region (“show more”).

Not for: content everyone needs to read (just show it), switching between peer views (use tabs).

Variants

default divides items with a line, cards separates them as surfaces, flush drops the lines and tightens the spacing. Items can be disabled one by one or all at once.

default

Orders over $50 ship free and arrive in 3 to 5 business days.

cards

Orders over $50 ship free and arrive in 3 to 5 business days.

flush

Orders over $50 ship free and arrive in 3 to 5 business days.

Collapsible

Collapsible, CollapsibleTrigger and CollapsibleContent are the same animated region without the group: one trigger, one region, open / defaultOpen / onOpenChange.

Changed files

6 files in this commit

package.json

Find in page

Closed content stays in the DOM with hidden="until-found". In browsers that support it (Chromium), Ctrl + F finds text inside a closed item and opens it. Elsewhere the content is hidden normally.

API

Accordion

PropTypeDefaultDescription
type'single' | 'multiple'—Required. One open item at a time, or any number.
valuestring | string[]—Controlled open item(s): a string for single, an array for multiple.
defaultValuestring | string[]—Initially open item(s) when uncontrolled.
onValueChange(value) => void—Called with the new value (string for single, string[] for multiple).
collapsiblebooleanfalsesingle only: allow the open item to be closed again.
variant'default' | 'cards' | 'flush''default'Divided, separated surfaces, or flush.
disabledbooleanfalseDisable every item.

AccordionItem

PropTypeDefaultDescription
valuestring—Required. Identifies the item in the accordion value.
disabledboolean—Disable this item.

AccordionTrigger

PropTypeDefaultDescription
headingLevel2 | 3 | 4 | 5 | 63Heading that wraps the button, so the outline fits your page.

Collapsible

PropTypeDefaultDescription
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial state when uncontrolled.
onOpenChange(open: boolean) => void—Called when the region asks to open or close.
disabledbooleanfalseIgnore the trigger.

CollapsibleTrigger accepts asChild to use your own button. AccordionContent and CollapsibleContent hold the revealed content.

Keyboard

KeyAction
Enter / SpaceOpens or closes the focused item.
↓Moves focus to the next header; wraps around.
↑Moves focus to the previous header; wraps around.
Home / EndFirst / last header.
TabMoves through headers and the focusable content of open items.

Accessibility

  • Follows the WAI-ARIA accordion pattern: each trigger is a button inside a heading with aria-expanded and aria-controls; the region is labelled by its trigger.
  • Closed content is not focusable and not read by screen readers.
  • Disabled items stay in the order but cannot be opened or focused.

Motion

  • Open: the row grows from 0 to its content height on the smooth spring (about 540ms, no overshoot) while the content fades in.
  • Close: 260ms, so it leaves quicker than it arrives. The chevron turns 180 degrees in 220ms.
  • An item that starts open does not animate on load.
  • Reduced motion: it opens and closes without movement.