Search

Search documentation

Badge

Displays a badge or a component that looks like a badge.

Installation

pnpm dlx shadcn@latest add @evolphin/badge

Usage

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

Type Definitions

interface BadgeProps {
  /** The visual style of the badge */
  variant?: "default" | "secondary" | "destructive" | "outline";
BadgeProps.variant?: "default" | "secondary" | "destructive" | "outline" | undefined

The visual style of the badge

}

Examples

Default

Badge

Secondary

Secondary

Destructive

Destructive

Outline

Outline

API Reference

Badge

PropTypeDefaultDescription
variant`"default" \"secondary" \"destructive" \
classNamestring-Additional CSS classes

Accessibility

  • The Badge component renders as a div by default, but can be changed to any other element using asChild.

On this page