navigationbeta

Accordion

Accordion component for Vellira applications.

Documentation
Preview
Live
Options

Usage

Import the component and configure it with the same props used in the playground.

tsx

Examples

Common patterns and practical usage examples.

Basic

A single accordion keeps one settings section visible at a time.

tsx

Multiple open items

Use multiple mode when people need to compare information across sections.

Invoices are issued monthly with a separate annual tax summary.
Workspace exports include the last 90 days by default.
tsx

Collapsible single item

Allow the current section to close when the interface can return to an empty state.

Update your public profile and account details.
tsx

Controlled state

Store the open section in application state when another part of the interface needs to control it.

Password, passkey, and recovery settings are managed in this section.
tsx

Default expanded state

Set an initial expanded item while keeping later changes uncontrolled.

Choose when you want to receive updates.
tsx

Disabled state

Disable the whole accordion or a single item while preserving visible context.

tsx

Rich content

Panels can contain structured content for support notes or account summaries.

Include ownership, status, and next action so the next teammate can continue without opening another view.

  • Owner: Customer operations
  • Status: Waiting for workspace admin
  • Next action: Confirm billing contact
tsx

API

Props available for the React Accordion.

14 props

Accordion

PropTypeDefaultDescription
children
ReactNode-Compound Accordion.Item, Accordion.Trigger, and Accordion.Content nodes.
type
'single' | 'multiple''single'Determines whether one item or multiple items can be expanded.
value
string | string[]-Controlled expanded value or values.
defaultValue
string | string[]-Initial expanded value or values for uncontrolled usage.
onValueChange
((value: string) => void) | ((value: string[]) => void)-Called with the next expanded value or values after interaction.
collapsible
booleanfalseAllows an expanded single item to collapse back to no selection.
disabled
booleanfalseDisables interaction for the root, item, or trigger.

Accordion.Item

PropTypeDefaultDescription
children
ReactNode-Compound Accordion.Item, Accordion.Trigger, and Accordion.Content nodes.
valueRequired
string-Controlled expanded value or values.
disabled
booleanfalseDisables interaction for the root, item, or trigger.

Accordion.Trigger

PropTypeDefaultDescription
children
ReactNode-Compound Accordion.Item, Accordion.Trigger, and Accordion.Content nodes.
disabled
booleanfalseDisables interaction for the root, item, or trigger.

Accordion.Content

PropTypeDefaultDescription
children
ReactNode-Compound Accordion.Item, Accordion.Trigger, and Accordion.Content nodes.
forceMount
boolean-Keeps content mounted even when the item is collapsed.

Accessibility

Guidance for accessible usage and interaction.

Keyboard operation

Triggers are native buttons. Tab to a trigger and use Enter or Space to expand or collapse its section.
disabled

Expanded state

Each trigger exposes its expanded state and references the content panel it controls.

Related components

Explore components that are commonly used alongside this one.