@dafcoe/vue-collapsible-panel
Easy to use, customizable collapsible panel / accordion library built using Vue3.
Installation
Install the package as a project dependency using yarn
or npm
:
$ yarn add @dafcoe/vue-collapsible-panel
--- or ---
$ npm install --save @dafcoe/vue-collapsible-panel
Usage
Import VueCollapsiblePanelGroup
and VueCollapsiblePanel
components, either globally (on your main.js / main.ts file) or locally (on your component):
Import default styles (optional - you can define your own styling):
Use it in the template as follows:
Options
Accordion
By default, the accordion behaviour is not used. To use it, add the accordion
on vue-collapsible-panel-group
:
Expanded
By default, all the panels are expanded. To prevent this, add :expanded="false"
on vue-collapsible-panel
:
Colors
The default base hex color is #333
. To change this, add base-color="#<color>"
on vue-collpasible-panel-group
:
For granular control over the colors, the following css variables can be overridden: