Class: NitroKit::Badge
- Defined in:
- app/components/nitro_kit/badge.rb
Constant Summary collapse
- BADGE =
"inline-flex items-center gap-x-1.5 rounded-md font-medium"
- VARIANTS =
{ default: "border border-transparent bg-zinc-200 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300", outline: "border" }
- SIZES =
{ sm: "text-xs px-1.5 py-0.5", md: "text-sm px-2 py-0.5" }
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Attributes inherited from Component
Instance Method Summary collapse
-
#initialize(variant: :default, size: :md, **attrs) ⇒ Badge
constructor
A new instance of Badge.
- #view_template ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(variant: :default, size: :md, **attrs) ⇒ Badge
Returns a new instance of Badge.
15 16 17 18 19 20 |
# File 'app/components/nitro_kit/badge.rb', line 15 def initialize(variant: :default, size: :md, **attrs) super(**attrs) @variant = variant @size = size end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
22 23 24 |
# File 'app/components/nitro_kit/badge.rb', line 22 def size @size end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
22 23 24 |
# File 'app/components/nitro_kit/badge.rb', line 22 def variant @variant end |