Skip to content

Commit 462a8cd

Browse files
committed
Update README
1 parent 30d22ff commit 462a8cd

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1-
# accordion
2-
Front-end Accordion widget using max-height
1+
# Accordion
2+
3+
Front-end accordion widget using max-height written in vanilla ES2017
4+
5+
## Install
6+
7+
```
8+
npm i @three11/accordion
9+
```
10+
11+
or
12+
13+
```
14+
yarn add @three11/accordion
15+
```
16+
17+
## Usage
18+
19+
First, `import` the module:
20+
21+
```
22+
import Accordion from '@three11/accordion';
23+
```
24+
25+
Then initialize a new instance of the module:
26+
27+
```
28+
const el = doc.querySelector('[data-accordion]');
29+
const accordion = new Accordion(el, settings = {});
30+
```
31+
32+
## Settings
33+
34+
The default settings are:
35+
36+
```
37+
headSelector: '[data-title]', // Selector for the head element
38+
bodySelector: '[data-content]', // Selector for the body element
39+
hiddenClass: 'is--hidden', // Hidden class name
40+
activeClass: 'is--active', // Active class name
41+
```
42+
43+
## License
44+
45+
GNU GENERAL PUBLIC LICENSE
46+
Version 3, 29 June 2007

0 commit comments

Comments
 (0)