Class: UiComponents::DaisyUi::Action::ButtonComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- UiComponents::DaisyUi::Action::ButtonComponent
- Defined in:
- app/components/ui_components/daisy_ui/action/button_component.rb
Constant Summary collapse
- SHAPES =
%w[square circle]
- WIDE_SIZES =
%w[wide block]
- CSS_CLASSES_DEFAULT =
%w[btn].freeze
- CSS_CLASSES_VARIANTS =
( SIZES.map { |key| "btn-#{key}" } + COLORS.map { |key| "btn-#{key}" } + KINDS.map { |key| "btn-#{key}" } + SHAPES.map { |key| "btn-#{key}" } + WIDE_SIZES.map { |key| "btn-#{key}" } ).freeze
- CSS_CLASSES =
(CSS_CLASSES_DEFAULT + CSS_CLASSES_VARIANTS).freeze
Constants inherited from BaseComponent
BaseComponent::ALIGNS, BaseComponent::AXES, BaseComponent::COLORS, BaseComponent::KINDS, BaseComponent::SIZES
Instance Method Summary collapse
-
#initialize(size: nil, color: nil, kind: nil, shape: nil, wide_size: nil, no_btn: false, **args) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
Constructor Details
#initialize(size: nil, color: nil, kind: nil, shape: nil, wide_size: nil, no_btn: false, **args) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/components/ui_components/daisy_ui/action/button_component.rb', line 24 def initialize( size: nil, color: nil, kind: nil, shape: nil, wide_size: nil, no_btn: false, **args ) @size = size.to_s @color = color.to_s @kind = kind.to_s @shape = shape.to_s @wide_size = wide_size.to_s @no_btn = no_btn super(**args) end |