Accordion

A vertically stacked set of collapsible sections, each with a trigger header that toggles its content panel open or closed.

Default

We accept returns within 30 days of purchase. Items must be in their original condition and packaging.

Controlled

Onboarding guide

Fill in your name, email address, and a strong password. You'll receive a verification link in your inbox.

Currently open: step-1

Disabled

Entire accordion disabled

Your account details are currently read-only.

Individual item disabled

This feature is enabled and fully interactive.

Keep Mounted

keepMounted — panels remain in DOM when closed

This panel's DOM node is never removed — useful when the content has internal state you want to preserve across toggles.

hiddenUntilFound — browser search can reveal closed panels

Try using your browser's find-in-page (⌘F / Ctrl+F) to search for text inside this accordion. Closed panels will open automatically when a match is found.

Multiple

Multiple items can be open simultaneously.

Manage your display name, language preference, and time zone from the general settings panel.

Control who can see your profile, manage active sessions, and enable two-factor authentication for your account.

Nested Content

This project covers the full redesign of the onboarding flow, including mobile-first layouts and accessibility improvements.

Estimated timeline: 6 weeks. Primary stakeholders are Product, Design, and Engineering leads.

With Icon

Review login activity, manage trusted devices, and configure two-factor authentication to keep your account safe.

Installation

npx shadcn@latest add @byronwade/accordion

Props

PropTypeDefaultDescription
valueany[]Controlled array of expanded item values.
defaultValueany[]Uncontrolled initial array of expanded item values.
multiplebooleanfalseWhether multiple items can be open at the same time.
disabledbooleanfalseWhether the accordion ignores user interaction.
onValueChange(value: any[], eventDetails: AccordionRootChangeEventDetails) => voidCalled when an item is expanded or collapsed.
loopFocusbooleantrueWhether keyboard focus loops back to the first item when the end is reached.
keepMountedbooleanfalseWhether to keep panel content in the DOM while closed.
hiddenUntilFoundbooleanfalseUses hidden="until-found" so browser page search can find and expand panels.
orientation'horizontal' | 'vertical''vertical'Visual orientation that controls which arrow keys move focus.
classNamestringAdditional CSS class names applied to the root element.