An accessible tabs component to help structure large amounts of content on a page.
The tabs component is based on and extended from work done by the folks over at Simply Accessible. It is a stripped down, but still accessible version of UI tabs. They are keyboard accessible and user friendly and are meant to be a starting point for you to use on a project.
* Standalone JS is used on projects that are not set up to handle
ES6. To use this version you will need to download the UMD bundle from the NPM and pull it into your
project. The same process should be
followed with the CSS if it cannot process through the NPM package.
Documentation
Installation
This component accepts two arguments, the selector for the accordion container and an object containing optional callbacks.
npm install @10up/component-tabs --save
Options
List of Options for this component
orientation
Whether the tabs are horizontal or vertical, defaults to horizontal
onCreate
Called after the tab is initialized on page load
onTabChange
Called when a tab item is changed
Methods
List of avaliable methods
destroy()
Destroys the component, removing event listeners and any extra markup and attributes.