structyl

Accordion API

View component

The full prop reference for the Accordion component. A vertically stacked set of interactive headings that each reveal a section of content.

Import

tsx
import { Accordion } from '@structyl/styled';

Props

Accordion.Root

Root accordion container; supports single or multiple open items

PropTypeDefault
type#'single' | 'multiple'

Controls whether one or multiple items can be open at once

value#string | string[] (depends on type)

Controlled value; for 'single' type is string, for 'multiple' is string[]

defaultValue#string | string[] (depends on type)

Initial uncontrolled value; for 'single' is string, for 'multiple' is string[]

onValueChange#(value: string | string[]) => void

Fires when value changes; callback signature depends on type prop

collapsible#boolean

For 'single' type only; if true, allows the open item to be collapsed

false
disabled#boolean

Disables all accordion items

orientation#'vertical' | 'horizontal'

Keyboard navigation and layout direction

'vertical'
dir#'ltr' | 'rtl'

Text direction for RTL support

asChild#boolean

Render as child element (Radix asChild pattern)

variant#'default' | 'bordered' | 'separated' | 'flushed' | 'ghost'

Visual variant (styled layer only)

'default'
className#string

CSS class name

Accordion.Item

Individual accordion item wrapper

PropTypeDefault
value#string

Unique identifier for the item; used to match Root.value

disabled#boolean

Disables this specific item (can override Root.disabled)

asChild#boolean

Render as child element (Radix asChild pattern)

className#string

CSS class name

Accordion.Header

Semantic heading element wrapping the trigger; renders as h3

PropTypeDefault
asChild#boolean

Render as child element (Radix asChild pattern)

className#string

CSS class name

Accordion.Trigger

Clickable button to toggle item open/closed; includes chevron icon

PropTypeDefault
icon#React.ReactNode

Custom icon element; replaces default ChevronDown if provided

iconPosition#'left' | 'right'

Position of the icon relative to trigger text (styled layer only)

'right'
asChild#boolean

Render as child element (Radix asChild pattern)

className#string

CSS class name

Accordion.Content

Collapsible content region for accordion item

PropTypeDefault
forceMount#boolean

Keep DOM mounted even when closed (for animation control)

asChild#boolean

Render as child element (Radix asChild pattern)

className#string

CSS class name

Keyboard interactions

Adheres to the WAI-ARIA design pattern .

KeyDescription
Space / EnterExpands / collapses the focused panel.
ArrowDown / ArrowUpMoves focus between headers.
Home / EndMoves focus to the first / last header.

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library