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 | Default | Description |
|---|---|---|
list | BooleanWhether the Tab is an item in a | |
selected | BooleanWhether the Tab is selected or not. | |
with_panel | BooleanWhether the Tab has an associated panel. | |
panel_id | StringOnly applies if | |
icon_classes | BooleanClasses that must always be applied to icons. | |
wrapper_arguments | HashSystem 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 | Default | Description |
|---|---|---|
system_arguments | Hash |
icon
Icon to be rendered in the Tab left.
| Name | Default | Description |
|---|---|---|
kwargs | HashThe same arguments as |
text
The Tab's text.
| Name | Default | Description |
|---|---|---|
kwargs | HashThe same arguments as |
counter
Counter to be rendered in the Tab right.
| Name | Default | Description |
|---|---|---|
kwargs | HashThe same arguments as |
Methods
selected
Returns the value of attribute selected.