NavigationTab

ready
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.

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

NameDefaultDescription
list
Boolean

Whether the Tab is an item in a <ul> list.

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 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.

system_arguments

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.

NameDefaultDescription
system_arguments

icon

Icon to be rendered in the Tab left.

NameDefaultDescription
kwargs
Hash

The same arguments as Primer::Beta::Octicon.

text

The Tab's text.

NameDefaultDescription
kwargs
Hash

The same arguments as Primer::Beta::Text.

counter

Counter to be rendered in the Tab right.

NameDefaultDescription
kwargs
Hash

The same arguments as Primer::Beta::Counter.

Methods

selected

Returns the value of attribute selected.