Underline nav

The underline nav is used to display navigation in a horizontal tabbed format.

v0.23.0AlphaNot reviewed for accessibility

Description

Use UnderlineNav to style navigation links with a minimal underlined selected state, typically placed at the top of the page.

For panel navigation, use UnderlinePanels instead.

Accessibility

  • By default, UnderlineNav renders links within a <nav> element. <nav> has an implicit landmark role of navigation 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

NameDefaultDescription
tag

:nav

Symbol

One of :div or :nav.

label

N/A

String

Sets an aria-label that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements.

align

:left

Symbol

One of :left or :right. - Defaults to left

body_arguments

{}

Hash

System arguments for the body wrapper.

system_arguments

N/A

Hash

Examples

Slots

tabs

Use the tabs to list page links.

NameDefaultDescription
selected

N/A

Boolean

Whether the tab is selected.

system_arguments

N/A

Hash

actions

Use actions for a call to action.

NameDefaultDescription
tag

:div

Symbol

One of :div or :span.

system_arguments

N/A

Hash