Class: Solrengine::Ui::BadgeComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Solrengine::Ui::BadgeComponent
- Defined in:
- app/components/solrengine/ui/badge_component.rb
Constant Summary collapse
- VARIANTS =
{ success: "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 border-green-200 dark:border-green-700/50", warning: "bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-700/50", error: "bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 border-red-200 dark:border-red-700/50", info: "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-700/50", purple: "bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 border-purple-200 dark:border-purple-700/50" }.freeze
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
-
#initialize(text:, variant: :info) ⇒ BadgeComponent
constructor
A new instance of BadgeComponent.
- #variant_classes ⇒ Object
Constructor Details
#initialize(text:, variant: :info) ⇒ BadgeComponent
Returns a new instance of BadgeComponent.
16 17 18 19 |
# File 'app/components/solrengine/ui/badge_component.rb', line 16 def initialize(text:, variant: :info) @text = text @variant = variant end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
14 15 16 |
# File 'app/components/solrengine/ui/badge_component.rb', line 14 def text @text end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
14 15 16 |
# File 'app/components/solrengine/ui/badge_component.rb', line 14 def variant @variant end |