tabs
Accessible tabs, where aria states are automatically added.
To get Started
CommonJS
$ npm install vanilla-js-tabs
var Tabs = ;
Browser Global
Options
Option | Type | Default Value | Info |
---|---|---|---|
tablist | string | '.tablist' | refers to the selector on the tablist |
target | string | '.tab' | refers to the selector on the tabs |
panel | string | '.panel' | refers to the selector on the tab panels |
prefix | string | 'Tabs-' | sets the prefix for the ID/aria label if no ID is detected |
hashEnabled | boolean | true | activates tabs based on URL hash |
API
var tabs = document; tabs; tabs; // activates tab with a specific indextabs;tabs;tabs;
Accessibility
http://www.w3.org/TR/wai-aria-practices/#tabpanel
I left out the ctrl + pageup and ctrl + pagedown interactions, since those are already used to switch between browser tabs in Firefox and Chrome.
For Developers Working on this Module
- After you pull down the project, run
npm install
to get all of the node modules - You will want to work in the tabs.js file in the root
- To compile your changes, run
npm run build
(creates the CJS, IIFE and UMD versions of the module), thennpm run bundle-example
(creates the example file) - To test your changes, open example/index.html in a browser
License
MIT © The C2 Group