Class: UI::ButtonComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ButtonComponent
- Includes:
- ButtonBehavior
- Defined in:
- app/view_components/ui/button_component.rb
Overview
ButtonComponent - ViewComponent implementation
A versatile button component with multiple variants and sizes. Uses ButtonBehavior module for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(variant: "default", size: "default", type: "button", disabled: false, classes: "", **attributes) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
Methods included from ButtonBehavior
#button_classes, #button_html_attributes, #render_button
Constructor Details
#initialize(variant: "default", size: "default", type: "button", disabled: false, classes: "", **attributes) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
31 32 33 34 35 36 37 38 |
# File 'app/view_components/ui/button_component.rb', line 31 def initialize(variant: "default", size: "default", type: "button", disabled: false, classes: "", **attributes) @variant = variant @size = size @type = type @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
40 41 42 |
# File 'app/view_components/ui/button_component.rb', line 40 def call { content } end |