Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Badge with Link (Secondary) for Vue

A muted secondary badge whose label Badge is a link that underlines on hover. The address is #link.

UI library: Ark UI

The word Badge is a link on a muted fill. Hovering underlines it. The href in this file is #link.

Reach for it on supporting tags that should be easy to find but should not lead the page. An on and off filter is a Button. In Vue, Ark UI makes the badge a link.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Badge anatomy: root, icon, text

Usage

<Badge :asChild="true" class="hover:underline" variant="secondary">
  <a href="#link">Badge</a>
</Badge>

FAQ

What does variant secondary change on the link?

variant="secondary" keeps the muted secondary fill and secondary-foreground text on the link. The variant adds a hover background when the badge is an anchor, 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.

Why doesn't the link text wrap?

The badge is whitespace-nowrap, so the label stays one line. Keep it to a word or two.

Can this link use another variant?

Yes. Set variant on the same Badge. The values are default, secondary, outline, ghost, link, destructive, info, success and warning.

API Reference

Badge

Sets asChild and variant="secondary". The rest is on the Badge page.