Class: Primer::TabNavComponent
- Includes:
- TabbedComponentHelper
- Defined in:
- app/components/primer/tab_nav_component.rb
Overview
Use ‘TabNav` to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.
Constant Summary
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
Primer::TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(label:, with_panel: false, body_arguments: {}, **system_arguments) ⇒ TabNavComponent
constructor
A new instance of TabNavComponent.
Methods included from TabbedComponentHelper
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(label:, with_panel: false, body_arguments: {}, **system_arguments) ⇒ TabNavComponent
Returns a new instance of TabNavComponent.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'app/components/primer/tab_nav_component.rb', line 88 def initialize(label:, with_panel: false, body_arguments: {}, **system_arguments) @with_panel = with_panel @system_arguments = system_arguments @body_arguments = body_arguments @system_arguments[:tag] ||= :div @system_arguments[:classes] = class_names( "tabnav", system_arguments[:classes] ) @body_arguments[:tag] = (with_panel) @body_arguments[:"aria-label"] = label @body_arguments[:role] = :tablist if @with_panel @body_arguments[:classes] = class_names( "tabnav-tabs", body_arguments[:classes] ) end |