NavigationTab
Description
This component is part of navigation components such as Primer::Alpha::TabNav
and Primer::Alpha::UnderlineNav
and should not be used by itself.
Accessibility
Tab
renders the selected anchor tab with aria-current="page"
by default.
When the selected tab does not correspond to the current page, such as in a nested inner tab, make sure to use aria-current="true"
Arguments
Name | Required | Description |
---|---|---|
list | Boolean Whether the Tab is an item in a | |
selected | Boolean Whether the Tab is selected or not. | |
with_panel | Boolean Whether the Tab has an associated panel. | |
panel_id | String Only applies if | |
icon_classes | Boolean Classes that must always be applied to icons. | |
wrapper_arguments | Hash System arguments to be used in the | |
system_arguments | Hash |
Slots
panel
Panel controlled by the Tab. This will not render anything in the tab itself.
It will provide a accessor for the Tab's parent to call and render the panel
content in the appropriate place.
Refer to UnderlineNav
and TabNav
implementations for examples.
Name | Required | Description |
---|---|---|
system_arguments | Hash |
icon
Icon to be rendered in the Tab left.
Name | Required | Description |
---|---|---|
kwargs | Hash The same arguments as |
text
The Tab's text.
Name | Required | Description |
---|---|---|
kwargs | Hash The same arguments as |
counter
Counter to be rendered in the Tab right.
Name | Required | Description |
---|---|---|
kwargs | Hash The same arguments as |
Methods
selected
Returns the value of attribute selected.