Class: Daisy::DataDisplay::TextRotateComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::DataDisplay::TextRotateComponent
- Includes:
- LocoMotion::Concerns::TippableComponent
- Defined in:
- app/components/daisy/data_display/text_rotate_component.rb
Overview
The Text Rotate component displays up to 6 lines of text, one at a time, with an infinite loop CSS animation. The duration is 10 seconds by default and the animation pauses on hover. Common use cases include rotating hero headlines, cycling through feature keywords, or animating taglines on marketing pages.
Defined Under Namespace
Classes: ItemComponent
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#texts ⇒ Object
readonly
Returns the value of attribute texts.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(texts: nil, **kws, &block) ⇒ TextRotateComponent
constructor
Creates a new Text Rotate 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(texts: nil, **kws, &block) ⇒ TextRotateComponent
Creates a new Text Rotate component.
190 191 192 193 194 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 190 def initialize(texts: nil, **kws, &block) super(**kws, &block) @texts = texts end |
Instance Attribute Details
#texts ⇒ Object (readonly)
Returns the value of attribute texts.
174 175 176 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 174 def texts @texts end |
Instance Method Details
#before_render ⇒ Object
196 197 198 199 200 201 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 196 def before_render super setup_component setup_texts if texts end |