Class: UiComponents::DaisyUi::DataDisplay::BadgeComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/ui_components/daisy_ui/data_display/badge_component.rb

Constant Summary collapse

CSS_CLASSES_DEFAULT =
%w[badge].freeze
CSS_CLASSES_VARIANTS =
(
  SIZES.map { |key| "badge-#{key}" } +
  COLORS.map { |key| "badge-#{key}" } +
  KINDS.map { |key| "badge-#{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

Constructor Details

#initialize(size: nil, color: nil, kind: nil, **args) ⇒ BadgeComponent

Returns a new instance of BadgeComponent.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/components/ui_components/daisy_ui/data_display/badge_component.rb', line 19

def initialize(
    size: nil,
    color: nil,
    kind: nil,
    **args
  )
  @size = size.to_s
  @color = color.to_s
  @kind = kind.to_s

  super(**args)
end