Class: Yattho::Alpha::TabContainer
- Defined in:
- app/components/yattho/alpha/tab_container.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(Yattho::Alpha::TabNav) %>.
This component requires javascript.
Direct Known Subclasses
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ TabContainer
constructor
A new instance of TabContainer.
- #render? ⇒ Boolean
Methods inherited from Component
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) ⇒ TabContainer
Returns a new instance of TabContainer.
29 30 31 32 |
# File 'app/components/yattho/alpha/tab_container.rb', line 29 def initialize(**system_arguments) @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = "tab-container" end |
Instance Method Details
#call ⇒ Object
34 35 36 |
# File 'app/components/yattho/alpha/tab_container.rb', line 34 def call render(Yattho::BaseComponent.new(**@system_arguments)) { content } end |
#render? ⇒ Boolean
38 39 40 |
# File 'app/components/yattho/alpha/tab_container.rb', line 38 def render? content.present? end |