Module: Klods::Components::Card
- Included in:
- Builders
- Defined in:
- lib/klods/components/card.rb
Instance Method Summary collapse
- #card(a = nil, b = nil, &block) ⇒ Object
- #card_body(a = nil, b = nil, &block) ⇒ Object
- #card_footer(a = nil, b = nil, &block) ⇒ Object
- #card_title(a = nil, b = nil, &block) ⇒ Object
Instance Method Details
#card(a = nil, b = nil, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/klods/components/card.rb', line 4 def card(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build( tag: "div", base: "klods-card", modifiers: {elevated: "klods-card--elevated"}, props: props, children: children ) end |
#card_body(a = nil, b = nil, &block) ⇒ Object
20 21 22 23 24 |
# File 'lib/klods/components/card.rb', line 20 def card_body(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build(tag: "div", base: "klods-card__body", props: props, children: children) end |
#card_footer(a = nil, b = nil, &block) ⇒ Object
26 27 28 29 30 |
# File 'lib/klods/components/card.rb', line 26 def (a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build(tag: "div", base: "klods-card__footer", props: props, children: children) end |
#card_title(a = nil, b = nil, &block) ⇒ Object
14 15 16 17 18 |
# File 'lib/klods/components/card.rb', line 14 def card_title(a = nil, b = nil, &block) props, children = Core.normalize_args(a, b) children = klods_capture(&block) if block Core.build(tag: "h3", base: "klods-card__title", props: props, children: children) end |