Class: KozenetUi::ButtonComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- KozenetUi::ButtonComponent
- Defined in:
- app/components/kozenet_ui/button_component.rb
Overview
Apple-inspired button component with smooth interactions Supports multiple variants, sizes, and states
rubocop:disable Metrics/ClassLength
Constant Summary
Constants inherited from BaseComponent
KozenetUi::BaseComponent::UNSET
Instance Attribute Summary
Attributes inherited from BaseComponent
#html_options, #size, #variant
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(variant: :primary, size: :md, type: :button, href: nil, disabled: false, loading: false, full_width: false, html_options: {}) ⇒ ButtonComponent
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(variant: :primary, size: :md, type: :button, href: nil, disabled: false, loading: false, full_width: false, html_options: {}) ⇒ ButtonComponent
rubocop:disable Metrics/ParameterLists
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/components/kozenet_ui/button_component.rb', line 33 def initialize( variant: :primary, size: :md, type: :button, href: nil, disabled: false, loading: false, full_width: false, html_options: {} ) super(variant: variant, size: size, **) @type = type @href = href @disabled = disabled @loading = loading @full_width = full_width end |
Instance Method Details
#call ⇒ Object
rubocop:enable Metrics/ParameterLists
52 53 54 55 56 57 58 |
# File 'app/components/kozenet_ui/button_component.rb', line 52 def call if link? link_tag else end end |