Accordion
A vertical stack of headings that each open a section of content beneath them. One item opens at a time, the first when it loads, and a second click closes it again.
Usage
Examples
Appearances
appearance draws the items on the kit's one scale: solid, the default, soft and outline each a card of its own, and transparent plain rows with a line between them.
Sizes
size sets the padding of the triggers and the content: sm 8px for a compact panel, base 16px (the default) or lg 20px, its words and icons a step larger.
Border radius
borderRadius sets the corners of each item's card on the kit's one scale: none, xs 4px, sm 6px, base 8px (the default), lg 12px or xl 16px, the trigger following them; transparent rows have no corners.
With icon
An Icon in a trigger sits before its words, at the trigger's icon size.
Multiple
type="multiple" lets several items stay open at once, its defaultValue a list of them, where type="single" opens one at a time.
Unstyled
unstyled keeps the accordion's behaviour, its rows opening one at a time with the chevron turning, and drops the kit's fill, lines, padding and text style, for a host that paints it from its own styles, as a business site's accordion does; above it the default look.
Disabled
disabled on an item keeps it shut, dims its trigger and takes it out of the arrow keys, beside an item as it is by default.
API Reference
Accordion
AccordionProps · components/Accordion/Accordion.types.tsAccordionItem
AccordionItemProps · takes the props of Radix Accordion.ItemAccordionTrigger
AccordionTriggerProps · takes the props of Radix Accordion.TriggerAccordionContent
AccordionContentProps · takes the props of Radix Accordion.ContentIt also takes the props of Radix Accordion.Root.