Skip to content

Badge

A badge or a component that looks like a badge.

Installation

pnpm dlx shadcn@latest add @frontal-labs/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>;
}

API Reference

This is a custom component using Base UI's useRender hook, not a direct Base UI wrapper.

Badge

A badge component with variant and size options.

Examples

Outline

Secondary

Destructive

Info

Success

Warning

Error

Small

Large

With Icon

With Count