@meteora-digital/accordion-grids
v0.0.3
Published
A class to make accordion grid layouts a breeze
Downloads
2
Maintainers
Readme
Accordion Grid
Use this class to make Accordion Grid Layouts a breeze
Installation
npm i @meteora-digital/accordion-grids
yarn add @meteora-digital/accordion-grids
Usage
import AccordionGridController from '@meteora-digital/accordion-grids';
const Dropdown = new AccordionGridController(element);
// Load the content into the dropdown controller
Dropdown.setContent(content);
// Event listeners
Dropdown.on('open', () => element.classList.add('active'));
Dropdown.on('close', () => element.classList.remove('active'));
element.addEventListener('click', () => Dropdown.toggle());