class Primer::Alpha::UnderlineNav
accessibility considerations.
- See <%= link_to_component(Primer::Alpha::Navigation::Tab) %> for additional
For all other set of links, set tag to ‘:div`.
implicit landmark role of `navigation` which should be reserved for main links.
- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an
@accessibility
For panel navigation, use <%= link_to_component(Primer::Alpha::UnderlinePanels) %> instead.
of the page.
underlined selected state, typically placed at the top
Use `UnderlineNav` to style navigation links with a minimal
def body
def body Primer::BaseComponent.new(**@body_arguments) end
def initialize(label:, tag: TAG_DEFAULT, align: ALIGN_DEFAULT, body_arguments: {}, **system_arguments)
-
system_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> -
body_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> for the body wrapper. -
align
(Symbol
) -- <%= one_of(Primer::UnderlineNavHelper::ALIGN_OPTIONS) %> - Defaults to <%= Primer::UnderlineNavHelper::ALIGN_DEFAULT %> -
label
(String
) -- Sets an `aria-label` that helps assistive technology users understand the purpose of the links, and distinguish it from similar elements. -
tag
(Symbol
) -- <%= one_of(Primer::Alpha::UnderlineNav::TAG_OPTIONS) %>
def initialize(label:, tag: TAG_DEFAULT, align: ALIGN_DEFAULT, body_arguments: {}, **system_arguments) @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT) @system_arguments = system_arguments @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT) @system_arguments[:classes] = underline_nav_classes(@system_arguments[:classes], @align) @body_arguments = body_arguments @body_arguments[:tag] = :ul @body_arguments[:classes] = underline_nav_body_classes(@body_arguments[:classes]) aria_label_for_page_nav(label) end