Class: RubyUI::Button

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

Constant Summary

Constants inherited from Base

RubyUI::Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Button.



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

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

Instance Method Details

#view_templateObject



13
14
15
# File 'lib/ruby_ui/button/button.rb', line 13

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