1.0.5 • Published 5 years ago

@fantassin/toggable-element v1.0.5

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 years ago

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!

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago