Class: Brainzlab::Components::Button
- Defined in:
- lib/brainzlab/components/button.rb
Constant Summary collapse
- VARIANTS =
{ primary: 'btn-primary', secondary: 'btn-secondary', ghost: 'btn-ghost', danger: 'btn-danger' }.freeze
- SIZES =
{ sm: 'btn-sm', md: nil, lg: 'btn-lg' }.freeze
Instance Method Summary collapse
-
#initialize(variant: :primary, size: :md, lift: false, disabled: false, type: 'button', **attrs) ⇒ Button
constructor
A new instance of Button.
- #view_template ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(variant: :primary, size: :md, lift: false, disabled: false, type: 'button', **attrs) ⇒ Button
Returns a new instance of Button.
19 20 21 22 23 24 25 26 |
# File 'lib/brainzlab/components/button.rb', line 19 def initialize(variant: :primary, size: :md, lift: false, disabled: false, type: 'button', **attrs) @variant = variant @size = size @lift = lift @disabled = disabled @type = type @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/brainzlab/components/button.rb', line 28 def view_template(&) ( type: @type, class: , disabled: @disabled, **@attrs, & ) end |