Class: Daisy::DataInput::FieldsetComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::DataInput::FieldsetComponent
- Defined in:
- app/components/daisy/data_input/fieldset_component.rb
Overview
Use the caption slot (or the caption: argument) for caption /
helper text below the controls — it renders DaisyUI's
.fieldset-label, which (unlike .label / daisy_label) is not
white-space: nowrap, so long help text wraps instead of pushing the
form off-screen. .fieldset-label is display: flex, which splits a
sentence and an inline link into separate flex items; for prose that
contains a link, pass caption_css: "block" so the link flows inside
the sentence.
Renders a fieldset element, optionally with a legend, to group related form controls or content.
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
-
#initialize(legend: nil, caption: nil, **kws) ⇒ FieldsetComponent
constructor
A new instance of FieldsetComponent.
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(legend: nil, caption: nil, **kws) ⇒ FieldsetComponent
Returns a new instance of FieldsetComponent.
71 72 73 74 75 76 |
# File 'app/components/daisy/data_input/fieldset_component.rb', line 71 def initialize(legend: nil, caption: nil, **kws) @simple_legend = legend @simple_caption = caption super(**kws) end |
Instance Method Details
#before_render ⇒ Object
78 79 80 81 82 |
# File 'app/components/daisy/data_input/fieldset_component.rb', line 78 def before_render setup_component super end |