Skip to content

Animated Accordion for React

An animated React accordion whose sections open on a spring, with every trigger a real button in the tab order. Use it as a React accordion for an FAQ section on a pricing or landing page, where the default glass variant puts all questions in one card and the open item rises as a lighter pane.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/accordion.json

Orders leave within a day and arrive in two to four.

  • Accordion
  • AccordionItem
  • AccordionPanel
  • AccordionTrigger
  • +2 more

FAQ

The default glass variant: one card, and the open item rises as a lighter pane. Leading icons pick up the accent while open.

Orders placed before 2 pm ship the same day. Standard delivery takes three to five business days; express arrives the next business day in most cities.

Files to copy

3 folders · 2 files · 4 packages
From theme/src/
  • components/accordion/
  • lib/{cn.ts, heading.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/accordion.jsonRegistry item: accordion. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/button/
  • components/glass-card/
  • components/spinner/
  • hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}
  • motion/{gate.ts, light-follower.ts, tokens.ts}
  • lib/{form.ts, state-light.tsx}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json https://lokendra-builds.github.io/sheenui/r/glass-card.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Separated, several open

Each item is its own glass card. multiple lets any number stay open; the plus folds into a minus.

Any time. Upgrades apply at once and are prorated; downgrades take effect at the end of the billing period.

On the same day each month as your first payment. Annual plans are billed once a year and save two months.

Plain, controlled, inside a card

variant="plain" has no surface of its own, for settings inside an existing card. value / onValueChange control which sections are open; a disabled item stays visible.

Open: profile

Accordion

PropTypeDefaultDescription
variantAccordionVariant"glass"Surface style: "glass" is one glass card, "separated" gives every item its own card, "plain" has no surface.
classNamestringNoneAdds extra classes to the outer element.
multiplebooleanfalseLet several items stay open at once.
defaultValueany[]NoneValues of the items open at first (uncontrolled).
value / onValueChangeany[] / (value) => voidNoneControl which items are open.
hiddenUntilFoundbooleanfalseClosed panels stay in the page so the browser's find-in-page can open them.
disabledbooleanfalseDisables every item of the group.

AccordionItem

PropTypeDefaultDescription
classNamestringNoneAdds extra classes to the item element.
valueanyauto idNames the item for defaultValue / value.
disabledbooleanfalseThe trigger stays visible but cannot be toggled.
onOpenChange(open) => voidNoneCalled when this item opens or closes.

AccordionTrigger

PropTypeDefaultDescription
iconReactNodeNoneLeading icon in a small tile; it picks up the accent while the item is open. Hidden from screen readers.
descriptionReactNodeNoneShows a secondary line under the title.
indicator"chevron" | "plus""chevron""chevron" turns over; "plus" becomes a minus.
headingLevelHeadingLevelOption3Heading level of the wrapping header (2 to 6), to fit the page outline, or "none" for a paragraph with no heading role (for an example).
classNamestringNoneExtra classes for the trigger button.

AccordionPanel

PropTypeDefaultDescription
classNamestringNoneExtra classes for the panel (height-animated, clips while it moves).
contentClassNamestringNoneExtra classes for the padded content box inside the panel.
keepMountedbooleanfalseKeep closed content in the DOM.

Keyboard

KeysAction
Tab/Shift + TabMove between triggers (disabled items are skipped).
Enter/SpaceOpen or close the focused item.

Accessibility

  • Each trigger is a native button inside a heading (headingLevel sets the level) with aria-expanded and aria-controls.
  • Closed panels are hidden from the accessibility tree, so their links are not tabbable; hiddenUntilFound lets find-in-page open matching panels.
  • A disabled item is announced as dimmed; the chevron and icon tile are aria-hidden.

When to use Accordion

  • Use it for an FAQ below a pricing table, or a settings screen with long sections, where only the answer you open takes space and every trigger stays a real button in the tab order.
  • Use the separated variant with multiple for a settings or filter panel, where each group is its own glass card and several can stay open while someone compares them.
  • Use the plain variant inside an existing card, such as a checkout summary or a sidebar, when the accordion should not add a surface of its own.
  • Skip it when a section is independent and should not close its neighbors; Collapsible is a single show and hide region, and Tabs is better when users compare parallel views.
  • Pair it with Badge in a trigger description, Field and Input for settings groups inside panels, and the Kbd component to show shortcuts in help content.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .