@fantassin/toggable-element
v1.0.5
Published
Create Toggable Element quickly and with A11Y in mind 🌠
Downloads
4
Readme
Toggable Element
Create Toggable Element quickly and with A11Y in mind 🌠
How to use ?
<button class="menu__button"></button>
<section class="menu">
<button class="menu__button--close"></button>
<>...</>
</section>
Here is the markup. When you click on your button, it will open and add the class of your ${selector}--open
.
When the markup is done, create the JS
import ToggableElement from '@fantassin/toggable-element'
const menu = new ToggableElement('.menu');
And... It's done!