shadcn.io is an independent project built on shadcn/ui
A star sits before the word Badge on a muted fill. The star is decorative, and the label stays on one line.
Put it on metadata where a symbol helps and a strong color would distract. A sentence belongs in an Alert, not here. In Vue, Ark UI reads the word with the text around it.
Installation
Anatomy

Usage
<Badge variant="secondary">
<StarIcon aria-hidden="true" data-icon="inline-start" />Badge
</Badge>FAQ
How does the star sit before the label in Vue?
The icon is the first child, with data-icon="inline-start" and aria-hidden="true". The badge styles size the svg and space it with the badge's gap, so the icon has no size class.
Why hide the star from assistive tech?
The label is the word in the badge. The star is decoration.
aria-hidden="true" is already on the icon, so screen readers read the word and skip the star.
Does the star need its own color?
No. Lucide icons paint with currentColor, so the star uses the badge's text color and follows the variant, including in dark mode.
What does variant secondary change?
variant="secondary" uses the secondary background and secondary-foreground text. The star stays the first child, with the same icon attributes as in this file.
API Reference
Badge
Sets variant="secondary". The rest is on the Badge page.


