Skip to content

Accordion

A vertically stacked set of collapsible sections, single or multiple open at a time.

Styled with CSS Tailwind

Basic Accordion (Single)

Only one item can be open at a time. DefaultValue seeds the initial open item. Each trigger gets aria-expanded and aria-controls automatically. Every trigger sits in a BitBhAccordionHeader - an <h3> unless As says otherwise - as the accordion pattern asks, so screen readers list the items among the page's headings.

bit Bheadless is a headless component library for Blazor. Behaviour and accessibility are built in; styling is entirely up to you.

Multiple Open Items

Set Type="BitBhAccordionType.Multiple" to allow any number of panels open simultaneously.

Disabled Item

Individual items can be disabled via Disabled="true". The whole accordion can also be disabled at the root. A disabled item and its trigger get data-disabled: the CSS version styles them with [data-disabled] selectors, the Tailwind version with the data-disabled: variant.

Controlled Accordion

Drive the open state externally with Value + OnValueChange. The button below toggles "Panel 2" programmatically.

Open: none

An unhandled error has occurred. Reload 🗙