Skip to main content

Accordion

The Accordion component displays vertically stacked collapsible panels. It supports single or multiple expanded items, disabled sections, flush styling, and Bootstrap-compatible utility props.

Import​

import { Accordion } from "@promethey/bsui";

Note

Badge inherits all utility props supported by the Prime component, including layout, spacing, typography, colors, borders, sizing, positioning, and other Bootstrap utility APIs.

Basic usage​

Default active item​

Use defaultActiveKey to specify which item should be expanded initially.

Multiple open items​

Enable multiple expanded panels with the alwaysOpen prop.

Flush​

Remove background, borders, and rounded corners with the flush prop.

Disabled item​

Disable interaction for specific accordion sections using the disabled prop.

Utility props​

All utility props provided by Prime are supported.

API​

Accordion​

PropTypeDefaultDescription
childrenReactNode—Accordion content.
classNamestring | object | array—Additional CSS classes.
styleobject—Inline styles.
flushbooleanfalseRemoves default background, borders, and rounded corners.
defaultActiveKeystring | string[]""Initially expanded item key or keys.
alwaysOpenbooleanfalseAllows multiple items to remain expanded.

Accordion.Item​

PropTypeDefaultDescription
childrenReactNode—Item content.
itemKeystring""Unique item identifier.
disabledbooleanfalseDisables expansion.
classNamestring—Additional CSS classes.
styleobject—Inline styles.

Accordion.Header​

PropTypeDefaultDescription
childrenReactNode—Header content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.

Accordion.Body​

PropTypeDefaultDescription
childrenReactNode—Body content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.

Accordion.Button​

PropTypeDefaultDescription
childrenReactNode—Button content.
collapsedbooleantrueControls collapsed state styling.
disabledbooleanfalseDisables the button.
onClickfunction—Click callback.
classNamestring—Additional CSS classes.

Accordion.Collapse​

PropTypeDefaultDescription
childrenReactNode—Collapsible content.
openbooleanfalseControls expanded state.
timeoutnumber350Collapse animation duration.