Usage
Use theUAccordion component to create expandable/collapsible content sections.
Props
as
- Type:
any - Default:
'div'
items
- Type:
AccordionItem[]
type
- Type:
'single' | 'multiple' - Default:
'single'
collapsible
- Type:
boolean - Default:
true
type is 'single'.
defaultValue
- Type:
string | string[]
modelValue
- Type:
string | string[]
disabled
- Type:
boolean
unmountOnHide
- Type:
boolean - Default:
true
trailingIcon
- Type:
string(Iconify icon name) - Default:
appConfig.ui.icons.chevronDown
valueKey
- Type:
string - Default:
'value'
labelKey
- Type:
string - Default:
'label'
class
- Type:
any
ui
- Type:
object
root- The root containeritem- Each accordion itemheader- The item headertrigger- The clickable triggerleadingIcon- The leading iconlabel- The label texttrailingIcon- The trailing iconcontent- The collapsible content wrapperbody- The content body
Events
Inherits all events from Reka UI’sAccordionRoot.
Slots
leading
- Props:
{ item: T, index: number, open: boolean, ui: Accordion['ui'] }
default
- Props:
{ item: T, index: number, open: boolean }
trailing
- Props:
{ item: T, index: number, open: boolean, ui: Accordion['ui'] }
content
- Props:
{ item: T, index: number, open: boolean, ui: Accordion['ui'] }
body
- Props:
{ item: T, index: number, open: boolean, ui: Accordion['ui'] }
Dynamic Slots
You can use dynamic slots based on theslot property of items:
[item.slot]- Custom content slot[item.slot]-body- Custom body slot