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, **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, **system_arguments) ⇒ TabNavComponent
Returns a new instance of TabNavComponent.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'app/components/primer/tab_nav_component.rb', line 74 def initialize(label:, with_panel: false, **system_arguments) @with_panel = with_panel @system_arguments = system_arguments @system_arguments[:tag] ||= :div @system_arguments[:classes] = class_names( "tabnav", system_arguments[:classes] ) @body_arguments = { tag: (with_panel), classes: "tabnav-tabs", aria: { label: label } } @body_arguments[:role] = :tablist if @with_panel end |