A primary-color variation of the badge.
Badge.primary "NEW"Badges are small elements displayed, usually on the right of texts or top-right corner of the view, serving as counters, tags, or labels.
Six color schemes are available: Primary, Warning, Danger, Success, Light, and Dark.
But, brightness can also variate using the palette's brightness values with Badge.withBrightness.
A badge can be created and rendered as in the following pipeline:
Element.row []
[ -- Some cool content
, Badge.dark (String.fromInt (List.length someList))
|> Badge.renderElement renderConfig
|> Element.el [ Element.alignTop ]
]With Badge.withBrightness, you'll be able to apply a different brightness for any badge.
See Palette.brightness* for acceptable values.
Badge.success "SENT"
|> Badge.withBrightness Palette.brightnessLight
|> Badge.renderElement renderConfigEnd of the builder's life. The result of this function is a ready-to-insert Elm UI's Element.
The
Badgetype is used for describing the component for later rendering.