Class: StimulusPlumbers::Components::Card::Renderer
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Card::Renderer
- Defined in:
- lib/stimulus_plumbers/components/card/renderer.rb
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Components::Plumber::Base
Instance Method Details
#card(title: nil, **kwargs, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/stimulus_plumbers/components/card/renderer.rb', line 7 def card(title: nil, **kwargs, &block) = ( { classes: theme.resolve(:card).fetch(:classes, "") }, kwargs ) template.content_tag(:div, **) do template.safe_join( [ (template.content_tag(:h2, title) if title.present?), template.capture(&block) ].compact ) end end |
#section(title: nil, **kwargs, &block) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/stimulus_plumbers/components/card/renderer.rb', line 23 def section(title: nil, **kwargs, &block) = ( { classes: theme.resolve(:card_section).fetch(:classes, "") }, kwargs ) template.content_tag(:div, **) do template.safe_join( [ (template.content_tag(:h3, title) if title.present?), template.capture(&block) ].compact ) end end |