Class: StimulusPlumbers::Components::ActionList::Section
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::ActionList::Section
- Defined in:
- lib/stimulus_plumbers/components/action_list/section.rb
Constant Summary
Constants included from Plumber::HtmlOptions
Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#extract_classes, #merge_data_options, #merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Method Details
#render(title: nil, **kwargs, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/stimulus_plumbers/components/action_list/section.rb', line 7 def render(title: nil, **kwargs, &block) template.content_tag(:li, **kwargs) do ul_opts = {} ul_opts[:aria] = { label: title } if title.present? template.safe_join( [ (template.content_tag(:span, title, aria: { hidden: "true" }) if title.present?), template.content_tag(:ul, template.capture(&block), **ul_opts) ] ) end end |