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.
188 189 190 191 192 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 188 def initialize(texts: nil, **kws, &block) super(**kws, &block) @texts = texts end |
Instance Attribute Details
#texts ⇒ Object (readonly)
Returns the value of attribute texts.
172 173 174 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 172 def texts @texts end |
Instance Method Details
#before_render ⇒ Object
194 195 196 197 198 199 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 194 def before_render super setup_component setup_texts if texts end |