Module: Klods::Components::Alert
- Included in:
- Builders
- Defined in:
- lib/klods/components/alert.rb
Instance Method Summary collapse
Instance Method Details
#alert(a = nil, b = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/klods/components/alert.rb', line 4 def alert(a = nil, b = nil) props, children = Core.normalize_args(a, b) merged = {"role" => "alert"}.merge(props.transform_keys(&:to_s)) Core.build( tag: "div", base: "klods-alert", modifiers: { variant: ->(v) { (v && v.to_s != "default") ? "klods-alert--#{v}" : nil } }, props: merged, children: children ) end |