butane-show-hide

1.0.0-alpha.2 • Public • Published

butane-show-hide

An accessibile show/hide JS library

Features

✔︎ Traps focus via the inert attribute
✔︎ Hide via the ESC key or an optional overlay
✔︎ Assumes no styling layer

Install

$ npm install butane-show-hide --save-dev

Usage

import ButaneShowHide from 'butane-show-hide'
 
ButaneShowHide.init()

Options

ButaneShowHide.init({
  showTrigger: 'data-custom-show',
  hideTrigger: 'data-custom-hide',
  onShow: (trigger, target) => console.log('Show ' + target.getAttribute('id')),
  onHide: (trigger, target) => console.log('Hide ' + target.getAttribute('id'))
})

License

MIT. © 2018 Alex Carpenter

Package Sidebar

Install

npm i butane-show-hide

Weekly Downloads

3

Version

1.0.0-alpha.2

License

ISC

Last publish

Collaborators

  • alexcarpenter