This component is part of navigation components such as Primer::Alpha::TabNav
and Primer::Alpha::UnderlineNav and should not be used by itself.
Accessibility
TabComponent 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
Type
Default
Description
list
Boolean
false
Whether the Tab is an item in a <ul> list.
selected
Boolean
false
Whether the Tab is selected or not.
with_panel
Boolean
false
Whether the Tab has an associated panel.
panel_id
String
""
Only applies if with_panel is true. Unique id of panel.
icon_classes
Boolean
""
Classes that must always be applied to icons.
wrapper_arguments
Hash
{}
System arguments to be used in the <li> wrapper when the tab is an item in a list.
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.