Skip to content

Badge

A small label for status, category, or metadata.

LabelStatus
npx shadcn@latest add @silicon-ui/badge

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/badge

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/badge/badge.tsx
    • components/silicon-ui/badge/badge.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { Badge } from "@/components/silicon-ui/badge/badge";

API reference

PropTypeDefault
tone

Defaults to neutral.

BadgeTone

"danger""info""success""warning""neutral""blue""violet""green""amber""orange""coral""rose"

"neutral"
size

Defaults to md (24px).

BadgeSize

"sm""md"

"md"
icon

An icon at the start, sized by the badge and coloured by its tone.

ReactNode—

Also accepts the props of HTMLAttributes<HTMLSpanElement>.

Dependencies

npm
motion
Registry
silicon-motion-tokens