--- import BadgeList from '@ui/BadgeList.astro' import DefaultLayout from '@shared/layouts/DefaultLayout.astro' import Icon from '@ui/Icon.astro' import ButtonList from '@ui/ButtonList.astro' import Card from '@ui/Card.astro' import CardBody from '@ui/CardBody.astro' import CardTitle from '@ui/CardTitle.astro' import CardSubtitle from '@ui/CardSubtitle.astro' import DropdownMenu from '@components/demo/DropdownMenu.astro' import site from '@data/site.json' import { ucFirst } from '@shared/lib/string-format' import DocsLink from '@ui/DocsLink.astro' const colors = [...Object.keys(site.colors), 'dark', 'light'] const sizes = ['sm', 'md', 'lg'] ---
In headings A badge scales with the heading level it sits next to.
Example heading New
Example heading New
Example heading New
Example heading New
Example heading New
Example heading New
Sizes Three sizes, with an optional icon before or after the label.
{ sizes.map((size) => ( Default Left icon Right icon )) }
Positioned Attach a count or a dot to a button with .badge-notification.
In a dropdown A badge inside a dropdown item.
On buttons Pair any badge color with a button label. { colors.map((color, index) => ( )) }
Notification dot A pill-shaped counter positioned on the corner of a button. { colors.map((color, index) => ( )) }
Blinking notification Add .badge-blink to draw attention to unread activity. { colors.map((color) => ( )) }
Basic Fill a badge with a theme or extended color. {colors.map((color) => {ucFirst(color)})}
Light A tinted background for a softer, secondary badge. {colors.map((color) => {ucFirst(color)})}
Outline A colored border with a transparent background. {colors.map((color) => {ucFirst(color)})}
With icons Add an icon before the label to reinforce its meaning. { colors.map((color) => ( {' '} {ucFirst(color)}{' '} )) }