Skip to main content

Accordion

A set of collapsible panels with headings.

We offer worldwide shipping with various delivery options to suit your needs. Orders are processed within 24 hours and typically arrive within 5-10 business days.

Features

Installation

typo3 ui:add accordion

Read more about installing Components and Primitives.

Examples

Multiple Expanded Panels

Allow multiple accordion items to be expanded at once by setting multiple to true.

Disabled Items

Disable specific accordion items to prevent interaction.

API Reference

The following tables cover the available props of the Fluid Primitives. For a full list of available client side props and methods, see the Zag.js Machine API.

accordion.root

Groups all parts of the accordion. Renders a <div> element.

NameDescriptionRequiredDefault
multipleboolean
Whether multiple accordion items can be expanded at the same time.
No
false
collapsibleboolean
Whether an accordion item can be closed after it has been expanded.
No
true
defaultValuestring[]
The initial value of the expanded accordion items. Use when you don't need to control the value of the accordion.
No
-
disabledboolean
Whether the accordion items are disabled.
No
-
orientationEnum\Orientation
The orientation of the accordion items.
No
Vertical

accordion.item

Groups an accordion header with the corresponding content. Renders a <div> element.

NameDescriptionRequiredDefault
valuestring
The value of the accordion item.
Yes
-
disabledboolean
Whether the accordion item is disabled.
No
-

accordion.itemHeader

A heading that labels the corresponding content. Renders an <h3> element.

NameDescriptionRequiredDefault
levelinteger
The heading level to render for the accordion item header.
No
3

accordion.itemContent

The content of the accordion item. Renders a <div> element.

accordion.itemTrigger

A button that opens and closes the corresponding item. Renders a <button> element.

accordion.itemIndicator

An optional visual indicator that can be used to show the open/closed state of the item. Renders a <div> element.

Anatomy

<primitives:accordion.root>
    <primitives:accordion.item>
        <primitives:accordion.itemHeader>
            <primitives:accordion.itemTrigger>
                <primitives:accordion.itemIndicator />
            </primitives:accordion.itemTrigger>
        </primitives:accordion.itemHeader>
        <primitives:accordion.itemContent />
    </primitives:accordion.item>
</primitives:accordion.root>