Prepared Docs

Prepared Docs

⌘K

    Loading navigation…

User

  1. Components
  2. Accordion
  3. API and Development

Accordion

API and Development

View Source
Submit Issue

Accordion groups content into collapsible sections that users can expand or collapse on demand. It offers three visual variants and supports single or multiple expansion to organize content efficiently.

Props

Accordion

Name

Type

Default

Description

className

string

—

Optional CSS class name for custom styling

collapsible

boolean

—

Whether the accordion can be collapsed after being expanded Not applicable for multiple; disallow usage

defaultValue

string | string[]

—

The value of the accordion that should be expanded by default The values of the accordion that should be expanded by default

ref

Ref<HTMLDivElement>

—

Ref for the accordion root element

type

AccordionType

—

Type of accordion - 'single' allows only one item to be open Type of accordion - 'multiple' allows multiple items to be open simultaneously

variant

AccordionVariant

—

Visual styling variant of the accordion

Storybook

Interactive examples and edge cases for this component are in Storybook.

Default
Ghost
Line
All Variants
Default Expanded Single
Default Expanded Multiple
With Ref
Single Interaction Test
Multiple Interaction Test

AccordionItem

Name

Type

Default

Description

value

string

required

Stable id for the item.

className

string

—

Custom classes.

children

ReactNode

required

AccordionTrigger and AccordionContent.

AccordionTrigger

Name

Type

Default

Description

className

string

—

Custom classes.

children

ReactNode

required

Header label and icons.

onClick

() => void

—

Optional extra click handling.

AccordionContent

Name

Type

Default

Description

className

string

—

Custom classes.

children

ReactNode

required

Expanded body content.

Variants

Default

With the strongest visual structure, this variant offers clear separation with borders and background color.

Ghost

Use for a subtle look with minimal chrome on collapsed items—ideal for reducing visual weight while preserving hierarchy.

Line

Use for text‑forward layouts with simple dividers between item, particularly amidst dense, text‑heavy content.

All variants

Default expanded (single)

Default expanded (multiple)

Types

Single

Use when only one section should be open at a time. Great for FAQs, settings panels, and any context where focus should remain on a single area.

Multiple

Use when users may need to compare or reference several sections at once, such as forms and filters.

Previous

Accordion / Usage

Next

Accordion / Accessibility

On this page

Props
Accordion
Storybook
AccordionItem
AccordionTrigger
AccordionContent
Variants
Default
Ghost
Line
All variants
Default expanded (single)
Default expanded (multiple)
Types
Single
Multiple