File tree Expand file tree Collapse file tree 1 file changed +46
-2
lines changed Expand file tree Collapse file tree 1 file changed +46
-2
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments