vue-simple-accordion
A simple, easily configurable accordion for Vue 2.x.
Installation
or
Import
or
Basic Usage
With the default options, the html will be generated as:
HTML structure
Available Options
All user options or component props if not set (or are undefined
) will automatically fallback to these default values:
Default Options
Component Props
vsa-list
Props | Type | Description |
---|---|---|
tags | Object | Define the html tags for the current list (check the default options for details) |
roles | Object | Define the html roles for the current list (check the default options for details) |
transition | String | Name of the entering/leaving transition effects for items |
initActive | Boolean | Expand the list by default or not |
forceActive | Boolean | When set, this will force the whole list to be expanded or collapsed |
autoCollapse | Boolean | When an item is active (expanded), the other items of the list will automatically collapse |
navigation | Boolean | Enable ↑ ↓ Home End navigation while focusing on a heading |
vsa-item
Props | Type | Description |
---|---|---|
transition | String | Name of the entering/leaving transition effects for the curren item |
initActive | Boolean | Expand the current item by default or not |
forceActive | Boolean | When set, this will force the current item to be expanded or collapsed |
level | String | Number | Identify aria-level while using heading: true |
onHeadingClick | Function | A function will be called automatically when the trigger button is clicked with the arguments contain data of the list and that item |
Priotiry: Item > List > Default
Styling
If you import the css, these CSS variables are available in .vsa-list
: