Class: Primer::TabContainerComponent
- Defined in:
- app/components/primer/tab_container_component.rb
Overview
Use TabContainer to create tabbed content with keyboard support. This component does not add any styles. It only provides the tab functionality. If you want styled Tabs you can look at <%= link_to_component(Primer::TabNavComponent) %>.
This component requires javascript.
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
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ TabContainerComponent
constructor
A new instance of TabContainerComponent.
- #render? ⇒ Boolean
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(**system_arguments) ⇒ TabContainerComponent
Returns a new instance of TabContainerComponent.
28 29 30 31 |
# File 'app/components/primer/tab_container_component.rb', line 28 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = "tab-container" end |
Instance Method Details
#call ⇒ Object
33 34 35 |
# File 'app/components/primer/tab_container_component.rb', line 33 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |
#render? ⇒ Boolean
37 38 39 |
# File 'app/components/primer/tab_container_component.rb', line 37 def render? content.present? end |