Module: Klods::Components::Card

Included in:
Builders
Defined in:
lib/klods/components/card.rb

Instance Method Summary collapse

Instance Method Details

#card(a = nil, b = nil) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/klods/components/card.rb', line 4

def card(a = nil, b = nil)
  props, children = Core.normalize_args(a, b)
  Core.build(
    tag: "div", base: "klods-card",
    modifiers: {elevated: "klods-card--elevated"},
    props: props, children: children
  )
end

#card_body(a = nil, b = nil) ⇒ Object



18
19
20
21
# File 'lib/klods/components/card.rb', line 18

def card_body(a = nil, b = nil)
  props, children = Core.normalize_args(a, b)
  Core.build(tag: "div", base: "klods-card__body", props: props, children: children)
end


23
24
25
26
# File 'lib/klods/components/card.rb', line 23

def card_footer(a = nil, b = nil)
  props, children = Core.normalize_args(a, b)
  Core.build(tag: "div", base: "klods-card__footer", props: props, children: children)
end

#card_title(a = nil, b = nil) ⇒ Object



13
14
15
16
# File 'lib/klods/components/card.rb', line 13

def card_title(a = nil, b = nil)
  props, children = Core.normalize_args(a, b)
  Core.build(tag: "h3", base: "klods-card__title", props: props, children: children)
end