Components
Accordion

Accordion

A collapsible component that displays content in a vertical stack.

API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.

AccordionProps

collapsible

boolean

Whether an accordion item can be collapsed after it has been opened.

defaultValue

string[]

dir

'ltr' | 'rtl'

The document's text/writing direction.

disabled

boolean

Whether the accordion items are disabled

getRootNode

() => ShadowRoot | Node | Document

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

id

string

The unique identifier of the machine.

ids

Partial<{ root: string item(value: string): string content(value: string): string trigger(value: string): string }>

The ids of the elements in the accordion. Useful for composition.

multiple

boolean

Whether multple accordion items can be open at the same time.

onFocusChange

(details: FocusChangeDetails) => void

The callback fired when the focused accordion item changes.

onValueChange

(details: ValueChangeDetails) => void

The callback fired when the state of opened/closed accordion items changes.

orientation

'horizontal' | 'vertical'

The orientation of the accordion items.

value

string[]

The `id` of the accordion item that is currently being opened.

AccordionContext

getContentProps

(props: ItemProps) => Dict<any>

getItemProps

(props: ItemProps) => Dict<any>

getItemState

(props: ItemProps) => ItemState

Gets the state of an accordion item.

getTriggerProps

(props: ItemProps) => Dict<any>

rootProps

Dict<any>

setValue

(value: string[]) => void

Sets the value of the accordion.

value

string[]

The value of the accordion

focusedValue

string

The value of the focused accordion item.

AccordionItemProps

value

string

disabled

boolean

AccordionItemContext

isDisabled

boolean

isFocused

boolean

isOpen

boolean

value

string

disabled

boolean

AccordionContentProps

lazyMount

boolean

Whether to enable lazy mounting. Defaults to `false`.

onExitComplete

() => void

present

boolean

unmountOnExit

boolean

Whether to unmount on exit. Defaults to `false`.