For more examples, visit the Storybook.

Example
<Accordion collapsible type="single">
    <StudsAccordionItem value="item-1">
        <StudsAccordionTrigger>
            Item 1
        </StudsAccordionTrigger>
        <StudsAccordionContent>
            This is the content for item 1.
        </StudsAccordionContent>
    </StudsAccordionItem>
</Accordion>

StudsAccordion Props

type
"single" | "multiple"
default:"single"

The type of accordion. “single” allows only one item to be expanded at a time, while “multiple” allows multiple items to be expanded.

collapsible
boolean
default:"false"

If true, allows the user to collapse an expanded item.

value
string

The controlled value of the item to expand

defaultValue
string

The value of the item to expand when initially rendered

disabled
boolean
default:"false"

If true, the accordion will be disabled.

onValueChange
function

Callback function that is called when the value changes.

<StudsAccordionItem>Props

value
string

The value of the accordion item.

asChild
boolean
default:"false"

If true, the accordion item will render as a child component.

disabled
boolean
default:"false"

If true, the accordion item will be disabled.