A button component with support for different colors, sizes and states out of the box. You can also customize it to your needs!
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Badge" icon="sparkles-16-solid" />
The badge component has support for the following colors:
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Primary" color="primary" /><Badge label="Success" color="success" /><Badge label="Warning" color="warning" /><Badge label="Danger" color="danger" /><Badge label="Info" color="info" /><Badge label="Monochrome" color="mono" />
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Default" variant="default" /><Badge label="Outlined" variant="outlined" /><Badge label="Flat" variant="flat" />
You can change the badge’s border-radius by setting the rounding
prop:
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Full" rounding="full" /><Badge label="Semi" rounding="semi" />
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Small" size="sm" /><Badge label="Medium" size="md" /><Badge label="Large" size="lg" />
You can use the built-in icons from HeroIcons ⤴ in the badge by passing the icon
prop:
---import { Badge } from 'studiocms:ui/components';---
<Badge label="Badge with Icon" icon="sparkles-16-solid" />