Class: KozenetUi::BadgeComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- KozenetUi::BadgeComponent
- Defined in:
- app/components/kozenet_ui/badge_component.rb
Overview
Badge component for labels, statuses, and counts Supports multiple variants and sizes
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
-
#initialize(variant: :primary, size: :md, pill: true, **html_options) ⇒ BadgeComponent
constructor
A new instance of BadgeComponent.
Constructor Details
#initialize(variant: :primary, size: :md, pill: true, **html_options) ⇒ BadgeComponent
Returns a new instance of BadgeComponent.
23 24 25 26 27 28 29 30 31 |
# File 'app/components/kozenet_ui/badge_component.rb', line 23 def initialize( variant: :primary, size: :md, pill: true, ** ) super(variant: variant, size: size, **) @pill = pill end |
Instance Method Details
#call ⇒ Object
33 34 35 36 37 |
# File 'app/components/kozenet_ui/badge_component.rb', line 33 def call tag.span(**html_attrs) do badge_content end end |