Class: PhlexUI::Button

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/button.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(variant: :primary, size: :md, icon: false, **attrs) ⇒ Button

Returns a new instance of Button.



5
6
7
8
9
10
# File 'lib/phlex_ui/button.rb', line 5

def initialize(variant: :primary, size: :md, icon: false, **attrs)
  @variant = variant.to_sym
  @size = size.to_sym
  @icon = icon
  super(**attrs)
end

Instance Method Details

#view_templateObject



12
13
14
# File 'lib/phlex_ui/button.rb', line 12

def view_template(&)
  button(**attrs, &)
end