react-web-tabs
Modular and accessible React tabs according to the WAI-ARIA Authoring Practices 1.1.
Installation
Note! This package depends on React ^15.5.4
Using npm:
Using yarn:
Then with a module bundler like webpack you can import it like usual:
The UMD build is also available on unpkg:
Usage
If you need to make it more interesting and mix in other elements you can do that to:
And of course every component supports adding additional props like custom className's or data attributes.
Styles
Some basic styles are provided as well but they are optional as the tabs are fully functional without styling and I do encourage you to create your own. Both minified and unminified versions are available in the /dist
folder.
With webpack:
Keyboard support
The following keys can be used to navigate between tabs when in focus, according to the WAI-ARIA Authoring Practices 1.1.
- ← Navigate to previous tab
- → Navigate to next tab
- HOME Navigate to first tab
- END Navigate to last tab
When the tabs are vertical:
- ↑ Navigate to previous tab
- ↓ Navigate to next tab
- HOME Navigate to first tab
- END Navigate to last tab