Class: Daisy::Layout::HeroComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Layout::HeroComponent
- Defined in:
- app/components/daisy/layout/hero_component.rb
Overview
The HeroComponent creates an eye-catching, full-width section typically used at the top of a page. Common use cases include:
-
Landing page introductions.
-
Feature showcases.
-
Call-to-action sections.
-
Image-rich banners.
The component is responsive by default and provides flexible layout options for content positioning and image integration.
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
-
#before_render ⇒ Object
Sets up the component’s CSS classes.
-
#initialize(**kws) ⇒ HeroComponent
constructor
Creates a new Hero 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
Constructor Details
#initialize(**kws) ⇒ HeroComponent
Creates a new Hero component.
72 73 74 |
# File 'app/components/daisy/layout/hero_component.rb', line 72 def initialize(**kws) super end |
Instance Method Details
#before_render ⇒ Object
Sets up the component’s CSS classes.
79 80 81 82 |
# File 'app/components/daisy/layout/hero_component.rb', line 79 def before_render add_css(:component, "hero") add_css(:content_wrapper, "hero-content") end |