Accordion
A vertically stacked set of interactive headings that each reveal a section of content.
Component Features
- 🎛️ Single/Multiple Mode: Supports both
single(one panel open at a time) andmultiple(multiple panels open simultaneously) modes. - 🔄 Fully Controlled: Control the expanded state via
v-modelordefaultValue. - ⚡ Lazy Rendering: Supports
lazyRender— content is only rendered when expanded. - ♿️ Accessibility: Built-in keyboard navigation and screen reader compatibility.
- 🎨 Theme Customization: Based on
BrConfigProviderfor global theming and TailwindCSS local overrides.
Basic Usage
The basic accordion mode only allows one panel to be expanded at a time. Use type="single" and collapsible to allow closing the currently open panel.
Multiple Panels
Set type="multiple" to allow multiple panels to be expanded at the same time.
Theming
Global Customization (BrConfigProvider) & Local Customization
You can override default CSS variables via the theme prop of BrConfigProvider, or directly override styles using TailwindCSS utility classes.
API
BrAccordion Props
BrAccordionItem Props
BrAccordionTrigger Props
Slots
BrAccordionTriggersupports#iconslot to customize the toggle icon.BrAccordionContenthas a default slot for the content.