class Primer::Alpha::TabPanels

Use ‘TabPanels` for tabs with panel navigation.

def before_render

def before_render
  # Eagerly evaluate content to avoid https://github.com/primer/view_components/issues/1790
  content
  super
end

def initialize(label:, body_arguments: {}, wrapper_arguments: {}, **system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • wrapper_arguments (Hash) -- <%= link_to_system_arguments_docs %> for the `TabContainer` wrapper.
  • body_arguments (Hash) -- <%= link_to_system_arguments_docs %> for the body wrapper.
  • align (Symbol) -- <%= one_of(Primer::TabNavHelper::EXTRA_ALIGN_OPTIONS) %> - Defaults to <%= Primer::TabNavHelper::EXTRA_ALIGN_DEFAULT %>
  • label (String) -- Sets an `aria-label` that helps assistive technology users understand the purpose of the tabs.
def initialize(label:, body_arguments: {}, wrapper_arguments: {}, **system_arguments)
  @align = EXTRA_ALIGN_DEFAULT
  @wrapper_arguments = wrapper_arguments
  @system_arguments = deny_tag_argument(**system_arguments)
  @system_arguments[:tag] = :div
  @system_arguments[:classes] = tab_nav_classes(@system_arguments[:classes])
  @body_arguments = deny_tag_argument(**body_arguments)
  @body_arguments[:tag] = :ul
  @body_arguments[:classes] = tab_nav_body_classes(@body_arguments[:classes])
  @body_arguments[:role] = :tablist
  @body_arguments[:"aria-label"] = label
end