**Collapsable** is a lightweight and flexible plugin that will let you create collapsable content. Use it for FAQ's, More information toggles or any way you see fit. A jQuery dependency is currently required. A native JS solution will be added in the near
npm install @mkoelewijn/collapsableCollapsable is a lightweight and flexible plugin that will let you create collapsable content.
Use it for FAQ's, More information toggles or any way you see fit.
A jQuery dependency is currently required. A native JS solution will be added in the near future.
javascript
npm install @mkoelewijn/collapsable
`Want to use yarn?
`javascript
yarn add @mkoelewijn/collapsable
`Usage
$3
`html
Collapsable title
Collapsable content
`$3
`scss
// Use the the file in the module
@use '@mkoelewijn/collapsable/dist/index';// Or define your own
[data-collapsable-target] {
display: none;
}
`$3
`javascript
const node = document.querySelector('[data-collapsable]');
new Collapsable(node, { // Optional callbacks
openStart: (instance) => {}
closeStart: (instance) => {}
});
``| | type | Default | Arguments |
|--- |--- |--- |---|
| Speed | Integer | 500 | |
| openStart | Function | | instance |
| closeStart | Function | | instance |