UnderlineNav

readyNot reviewed for a11y
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.

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 Primer::Alpha::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

NameRequiredDescription
tag
Symbol

One of :div or :nav.

label
String

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

align
Symbol

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

body_arguments
Hash

System arguments for the body wrapper.

system_arguments

Slots

tabs

Use the tabs to list page links.

NameRequiredDescription
selected
Boolean

Whether the tab is selected.

system_arguments

actions

Use actions for a call to action.

NameRequiredDescription
tag
Symbol

One of :div or :span.

system_arguments