Class: Daisy::DataDisplay::ListItemComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::DataDisplay::ListItemComponent
- Defined in:
- app/components/daisy/data_display/list_item_component.rb,
app/components/daisy/data_display/list_item_component.rb
Overview
The ListItem component represents an individual row within a List component. It provides a consistent layout for displaying content in a list format.
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
Called before rendering to setup the component CSS and structure.
- #call ⇒ Object
-
#initialize(**kwargs, &block) ⇒ ListItemComponent
constructor
Create a new ListItem 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(**kwargs, &block) ⇒ ListItemComponent
Create a new ListItem component.
26 27 28 |
# File 'app/components/daisy/data_display/list_item_component.rb', line 26 def initialize(**kwargs, &block) super end |
Instance Method Details
#before_render ⇒ Object
Called before rendering to setup the component CSS and structure
31 32 33 34 |
# File 'app/components/daisy/data_display/list_item_component.rb', line 31 def before_render set_tag_name(:component, :li) add_css(:component, "list-row") end |
#call ⇒ Object
36 37 38 |
# File 'app/components/daisy/data_display/list_item_component.rb', line 36 def call part(:component) { content } end |