TabNav
readyNot reviewed for a11y
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.
Description
Use TabNav
to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.
For panel navigation, use Primer::Alpha::TabPanels
instead.
Accessibility
- By default,
TabNav
renders links within a<nav>
element.<nav>
has an implicit landmark role ofnavigation
which should be reserved for main links. For all other set of links, set tag to:div
. - See
Primer::Alpha::Navigation::Tab
for additional accessibility considerations.
Arguments
Name | Required | Description |
---|---|---|
tag | Symbol One of | |
label | String Sets an | |
body_arguments | Hash System arguments for the body wrapper. | |
system_arguments | Hash |
Slots
tabs
Tabs to be rendered. For more information, refer to Primer::Alpha::Navigation::Tab
.
Name | Required | Description |
---|---|---|
selected | Boolean Whether the tab is selected. | |
system_arguments | Hash |
extra
Renders extra content to the TabNav
. This will be rendered after the tabs.
Name | Required | Description |
---|---|---|
align | Symbol One of |