Playground
Change the props and copy the code. The controls come from the component's TypeScript types.
Props
import { Badge } from "@/components/ui/badge";<Badge>Deployed</Badge>Installation
$ pnpm dlx shadcn@latest add @synccn/badgeFirst time in this project? Connect synccn with one command.
Usage
import { Badge } from "@/components/ui/badge";<Badge variant="success" dot>Deployed</Badge>API reference
Generated from the component's TypeScript types, so it always matches the code.
- variant
"default" | "secondary" | "outline" | "soft" | "success" | "warning" | "destructive"Default
"default"Colour style.
- dot
booleanDefault
falseShows a small dot before the label.
- className
stringExtra classes for the root element.
- children
React.ReactNodeContent to render.
Also accepts every standard <span> attribute, and forwards its ref.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
No ARIA roles, key handling or motion settings in its source. It renders plain elements, so its accessibility comes from the content and labels you give it.