Vue3 Accessible Accordion
A simple accordion component plugin for Vue 3. Follows the Accordion Design Pattern in WAI-ARIA Authoring Practices 1.1 for accessibility best practices automatically built into the plugin.
Install
npm i vue3-accessible-accordion
or
yarn add vue3-acccessible-accordion
Register as a Global Component
Register Components Individually
Example Usage
Components
<accordion>
Props
Prop | Type | Default | Required | Description |
---|---|---|---|---|
modelValue | Array | [] | No | Array of indexes of active tab panels. Defaults to an empty array - no panels will be open |
headerTag | String | h3 | No | HTML tag to be used for rendering around the button toggle of each accordion panel header |
collapsible | Boolean | true | false | Controls whether all accordion panels can be collapsed or if at least one has to be open at all times |
expandable | Boolean | false | false | Controls whether multiple accordion panels can be open at the same time |
Events
None
<accordion-panel>
Props
None
Events
None
<accordion-panel-header>
Props
None
Events
None
<accordion-panel-content>
Props
None
Events
None
Project setup
yarn
Compiles and hot-reloads for development
yarn serve
Compiles and minifies for production
yarn build