Badge

A badge or a component that looks like a badge.

API Reference

Installation

pnpm dlx cnippet@latest add badge

Usage

import { Badge } from "@/components/ui/badge"
<Badge>Badge</Badge>

You can use the render prop to make another component look like a badge. Here's an example of a link that looks like a badge.

import Link from "next/link"
 
import { Badge } from "@/components/ui/badge"
 
export function LinkAsBadge() {
  return <Badge render={<Link href="/pricing" />}>New</Badge>
}

Examples

Variants

Sizes