shadcn.io is an independent project built on shadcn/ui
The word Badge is a bordered link with no fill. Hovering underlines it. The href in this file is #link.
It fits a tag that opens a filtered view without a heavy fill. A toggle filter belongs on a Button. In React, Ark UI turns the badge into a link.
Preview
Installation
Anatomy

Usage
<Badge asChild className="hover:underline" variant="outline">
<a href="#link">Badge</a>
</Badge>FAQ
How does this badge become a link in React?
This demo underlines the link on hover.
Pass asChild and put an a inside, as this file does. className="hover:underline" is on Badge, and the styles move onto the link.
Use a real URL, not #.
What does variant outline change on the link?
variant="outline" keeps the border-border edge and text-foreground on the link. Hover adds the variant's background, and this file adds hover:underline.
Can I reach the link from the keyboard?
Yes. It is an a with an href, so Tab focuses it and Enter follows it. Screen readers announce a link.
Should a toggle filter be this badge?
No. This pattern goes to another page. An on and off filter is a Button or a toggle.
API Reference
Badge
Sets asChild and variant="outline". The rest is on the Badge page.




