Key Features
- Full keyboard navigation
 - Can expand one or multiple items
 - Collapse each accordion item
 - Horizontal or vertical orientations
 
Controlled
Use the open and onOpenChange props to control the state.
Multiple
Allow multiple accordion items to stay open at once using the multiple prop.
Collapsible
Allow closing all items when one is open using the collapsible prop.
Indicator
Add a custom indicator to accordion triggers.
Orientation
Render the accordion vertically or horizontally using the orientation prop.
Dir
Set the text direction (ltr or rtl) using the dir prop.
API Reference
Root
flex gap-2 w-full data-[orientation=vertical]:flex-col data-[orientation=horizontal]:flex-row| Prop | Default | Type | 
|---|---|---|
ids | — | Partial<{ root: string; item: (value: string) => string; itemContent: (value: string) => string; itemTrigger: (value: string) => string; }> | undefined The ids of the elements in the accordion. Useful for composition.  | 
multiple | false | boolean | undefined Whether multiple accordion items can be expanded at the same time.  | 
collapsible | false | boolean | undefined Whether an accordion item can be closed after it has been expanded.  | 
value | — | string[] | undefined The controlled value of the expanded accordion items.  | 
defaultValue | — | string[] | undefined The initial value of the expanded accordion items. Use when you don't need to control the value of the accordion.  | 
disabled | — | boolean | undefined Whether the accordion items are disabled  | 
onValueChange | — | ((details: ValueChangeDetails) => void) | undefined The callback fired when the state of expanded/collapsed accordion items changes.  | 
onFocusChange | — | ((details: FocusChangeDetails) => void) | undefined The callback fired when the focused accordion item changes.  | 
orientation | "vertical" | "horizontal" | "vertical" | undefined The orientation of the accordion items.  | 
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction.  | 
getRootNode | — | (() => ShadowRoot | Node | Document) | undefined A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Provider
| Prop | Default | Type | 
|---|---|---|
value | — | AccordionApi<PropTypes> | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | (accordion: AccordionApi<PropTypes>) => ReactNode | 
Item
flex gap-2 data-[orientation=vertical]:flex-col data-[orientation=horizontal]:flex-row| Prop | Default | Type | 
|---|---|---|
value | — | string The value of the accordion item.  | 
disabled | — | boolean | undefined Whether the accordion item is disabled.  | 
children | — | ReactNode | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
ItemTrigger
px-4 py-2 rounded-base w-full text-start hover:preset-tonal-primary| Prop | Default | Type | 
|---|---|---|
children | — | ReactNode | 
element | — | ((attributes: HTMLAttributes<"button">) => Element) | undefined Render the element yourself  | 
ItemIndicator
| Prop | Default | Type | 
|---|---|---|
children | — | ReactNode | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
ItemContent
py-2 px-4| Prop | Default | Type | 
|---|---|---|
children | — | ReactNode | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Root
flex gap-2 w-full data-[orientation=vertical]:flex-col data-[orientation=horizontal]:flex-row| Prop | Default | Type | 
|---|---|---|
ids | — | Partial<{ root: string; item: (value: string) => string; itemContent: (value: string) => string; itemTrigger: (value: string) => string; }> | undefined The ids of the elements in the accordion. Useful for composition.  | 
multiple | false | boolean | undefined Whether multiple accordion items can be expanded at the same time.  | 
collapsible | false | boolean | undefined Whether an accordion item can be closed after it has been expanded.  | 
value | — | string[] | undefined The controlled value of the expanded accordion items.  | 
defaultValue | — | string[] | undefined The initial value of the expanded accordion items. Use when you don't need to control the value of the accordion.  | 
disabled | — | boolean | undefined Whether the accordion items are disabled  | 
onValueChange | — | ((details: ValueChangeDetails) => void) | undefined The callback fired when the state of expanded/collapsed accordion items changes.  | 
onFocusChange | — | ((details: FocusChangeDetails) => void) | undefined The callback fired when the focused accordion item changes.  | 
orientation | "vertical" | "horizontal" | "vertical" | undefined The orientation of the accordion items.  | 
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction.  | 
getRootNode | — | (() => ShadowRoot | Node | Document) | undefined A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Provider
| Prop | Default | Type | 
|---|---|---|
value | — | () => AccordionApi<PropTypes> | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | Snippet<[() => AccordionApi<PropTypes>]> | 
Item
flex gap-2 data-[orientation=vertical]:flex-col data-[orientation=horizontal]:flex-row| Prop | Default | Type | 
|---|---|---|
value | — | string The value of the accordion item.  | 
disabled | — | boolean | undefined Whether the accordion item is disabled.  | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
ItemTrigger
px-4 py-2 rounded-base w-full text-start hover:preset-tonal-primary| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"button">]> | undefined Render the element yourself  | 
ItemIndicator
| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
ItemContent
py-2 px-4| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  |