Class: Daisy::Navigation::TabsComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Navigation::TabsComponent
- Defined in:
- app/components/daisy/navigation/tabs_component.rb
Defined Under Namespace
Classes: TabComponent
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#radio ⇒ Object
readonly
Returns the value of attribute radio.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(*args, **kws, &block) ⇒ TabsComponent
constructor
Create a new instance of the TabsComponent.
- #radio? ⇒ Boolean
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Methods included from LocoMotion::Concerns::InspectableComponent
Constructor Details
#initialize(*args, **kws, &block) ⇒ TabsComponent
Create a new instance of the TabsComponent.
208 209 210 211 212 213 |
# File 'app/components/daisy/navigation/tabs_component.rb', line 208 def initialize(*args, **kws, &block) super @name = config_option(:name, "tabs-#{SecureRandom.uuid}") @radio = config_option(:radio, false) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
188 189 190 |
# File 'app/components/daisy/navigation/tabs_component.rb', line 188 def name @name end |
#radio ⇒ Object (readonly)
Returns the value of attribute radio.
188 189 190 |
# File 'app/components/daisy/navigation/tabs_component.rb', line 188 def radio @radio end |
Instance Method Details
#before_render ⇒ Object
215 216 217 218 |
# File 'app/components/daisy/navigation/tabs_component.rb', line 215 def before_render add_css(:component, "tabs") add_html(:component, { role: "tablist" }) end |
#radio? ⇒ Boolean
220 221 222 |
# File 'app/components/daisy/navigation/tabs_component.rb', line 220 def radio? radio end |