Class: Daisy::DataDisplay::CardComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::DataDisplay::CardComponent
- Defined in:
- app/components/daisy/data_display/card_component.rb
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#simple_title ⇒ String
readonly
The title text when using the simple title option.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(**kws, &block) ⇒ CardComponent
constructor
Creates a new card component.
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(**kws, &block) ⇒ CardComponent
Creates a new card component.
88 89 90 91 92 |
# File 'app/components/daisy/data_display/card_component.rb', line 88 def initialize(**kws, &block) super @simple_title = kws[:title] end |
Instance Attribute Details
#simple_title ⇒ String (readonly)
Returns The title text when using the simple title option.
69 70 71 |
# File 'app/components/daisy/data_display/card_component.rb', line 69 def simple_title @simple_title end |
Instance Method Details
#before_render ⇒ Object
94 95 96 97 98 99 |
# File 'app/components/daisy/data_display/card_component.rb', line 94 def before_render setup_component super # Runs TippableComponent's setup hook with_title { simple_title } if simple_title && !title? end |