Class: StimulusPlumbers::Components::List

Inherits:
Plumber::Base show all
Defined in:
lib/stimulus_plumbers/components/list.rb,
lib/stimulus_plumbers/components/list/item.rb,
lib/stimulus_plumbers/components/list/section.rb,
lib/stimulus_plumbers/components/list/item/slots.rb

Defined Under Namespace

Classes: Item, Section

Instance Attribute Summary

Attributes inherited from Plumber::Base

#template

Instance Method Summary collapse

Methods inherited from Plumber::Base

#initialize, #theme

Methods included from Plumber::Renderer

#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?

Methods included from Plumber::Options::Aria

#labelled_aria

Methods included from Plumber::Options::Html

#merge_html_options

Constructor Details

This class inherits a constructor from StimulusPlumbers::Plumber::Base

Instance Method Details

#item(content = nil, **kwargs, &block) ⇒ Object



14
15
16
# File 'lib/stimulus_plumbers/components/list.rb', line 14

def item(content = nil, **kwargs, &block)
  List::Item.new(template).render(content, **kwargs, &block)
end

#renderObject



6
7
8
# File 'lib/stimulus_plumbers/components/list.rb', line 6

def render(...)
  render_list(...)
end

#sectionObject



10
11
12
# File 'lib/stimulus_plumbers/components/list.rb', line 10

def section(...)
  List::Section.new(template, heading_level: @heading_level).render(...)
end