Skip to content

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

Free

Badge with Text (Standard) for Vue

A default badge whose only content is the word Badge, filled with the primary color for a status or a tag.

UI library: Ark UI

The badge shows the word Badge on the primary fill. No variant is set, so it stays the default, and there is no icon.

Use it for the label you most want noticed, such as New or Beta. A sentence belongs in an Alert. In Vue, Ark UI keeps that word on one line.

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>Badge</Badge>

FAQ

Which variant is this badge?

No variant is set, so it stays default: the theme's primary fill and primary text. The other values are secondary, outline, ghost, link, destructive, info, success and warning.

How do I change the size or round it fully?

size takes sm, md or lg. pill rounds the badge fully. This demo sets neither, so you get the normal label.

Why doesn't the label wrap?

The badge is whitespace-nowrap, so the label stays one line. Shorten the text. A sentence belongs in an Alert.

How does the badge sit next to other text?

It is inline-flex and w-fit, so it hugs the label and stays on the line with a heading or a table cell. shrink-0 keeps it from being squashed in a tight row.

What does a screen reader hear?

The badge is a span, so the label is read with the text around it. Use a word that still makes sense in that sentence.

How do I give this badge a one-off color?

Add background and text classes on Badge, including the dark pair, such as bg-blue-50 text-blue-700 and dark:bg-blue-950 dark:text-blue-300. Keep variant for meaning, such as destructive for an error.

API Reference

Badge

No extra props in this demo. The rest is on the Badge page.