Badge
Displays a badge or a component that looks like a badge.
Usage
Default
Badge
Badge { "Badge" }
Copied!
Copy failed!
Primary
Primary
Badge(variant: :primary) { 'Primary' }
Copied!
Copy failed!
Outline
Outline
Badge(variant: :outline) { 'Outline' }
Copied!
Copy failed!
Variants
DestructiveWarningSuccess
div(class: 'flex flex-wrap gap-2 justify-center') do Badge(variant: :destructive) { 'Destructive' } Badge(variant: :warning) { 'Warning' } Badge(variant: :success) { 'Success' } end
Copied!
Copy failed!
Other colors
RedOrangeAmberYellowLimeGreenEmeraldTealCyanSkyBlueIndigoVioletPurpleFuchsiaPinkRose
div(class: 'flex flex-wrap gap-2 justify-center') do Badge(variant: :red) { 'Red' } Badge(variant: :orange) { 'Orange' } Badge(variant: :amber) { 'Amber' } Badge(variant: :yellow) { 'Yellow' } Badge(variant: :lime) { 'Lime' } Badge(variant: :green) { 'Green' } Badge(variant: :emerald) { 'Emerald' } Badge(variant: :teal) { 'Teal' } Badge(variant: :cyan) { 'Cyan' } Badge(variant: :sky) { 'Sky' } Badge(variant: :blue) { 'Blue' } Badge(variant: :indigo) { 'Indigo' } Badge(variant: :violet) { 'Violet' } Badge(variant: :purple) { 'Purple' } Badge(variant: :fuchsia) { 'Fuchsia' } Badge(variant: :pink) { 'Pink' } Badge(variant: :rose) { 'Rose' } end
Copied!
Copy failed!
Sizes
SmallMediumLarge
div(class: 'flex flex-wrap gap-2 justify-center items-center') do Badge(size: :sm) { "Small" } Badge(size: :md) { "Medium" } Badge(size: :lg) { "Large" } end
Copied!
Copy failed!
Components
Component | Built using | Source |
---|---|---|
Badge | Phlex |