Interactive Example
Branches
View and manage repository branches. Switch between different development branches to see their specific changes and commits.
- main
- develop
- feature/new-component
- hotfix/critical-bug
Tags
Browse repository tags and releases. Tags mark specific points in your repository''s history as important.
- v2.1.0
- v2.0.1
- v2.0.0
- v1.9.5
Commits
View recent commits and their details. Track changes made to the repository over time.
- Fix navigation bug in mobile view
- Add new tab panel component
- Update documentation
- Refactor CSS styles
Best practices
The same best practices apply to tab panels as they do to tab nav.
Anatomy
This is the tab panel content area where the active tab''s content is displayed.
Tab list: A set of buttons used to switch between views. Each tab should concisely label the view it''s associated with.
Tab panel: The view associated with the active tab.
Options
The same options are available to tab panels as they are to tab nav.
Accessibility
Keyboard navigation
Tabs, like all interactive elements, can be activated using a cursor or keyboard.
When a user moves focus into the tablist
using the Tab key, the active tab should be focused. A tablist
is only a single Tab stop. Once focused, navigation through the tablist
can then conducted with Left, Right, Home, and End keypresses.
Other a11y guidance
Tab nav and tab panels are almost identical. Reference the tab nav accessibility guidelines for more guidance.
Key(s) | Description |
---|---|
Tab | Moves focus from the tablist to the tab panel or next focusable node. |
Enter | Activates the focused tab. |
ArrowLeft | Activates the previous tab. If a user is focused on the first tab, wrap to activate the last tab. |
ArrowRight | Activates the next tab. If a user is focused on the last tab, wrap to activate the first tab. |
Please refer to internal accessibility documentation for TabPanels component issues.