Components
- Accordion
- Alert Dialog
- Alert
- Autocomplete
- Avatar
- Badge
- Button Group
- Button
- Card
- Carousel
- Chart
- Checkbox
- Clipboard
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Editable
- Field
- File Upload
- Floating Panel
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- QR Code
- Radio Group
- Rating Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Splitter
- Steps
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle Group
- Toggle
- Tooltip
- Tour
- Tree View
Favorite
Installation
pnpm dlx shadcn@latest add @shark-ui/badge
Usage
import { Badge } from "@/components/ui/badge";
<Badge>New</Badge>
Variants
You can change the variant of the badge using the variant prop.
Solid
Badge
Secondary
Badge
Outline
Badge
Success
Badge
Info
Badge
Warning
Badge
Destructive
Badge
Sizes
You can change the size of the badge using the size prop.
Small
Badge
Large
Badge
Pill
You can use the pill prop to create fully rounded badges.
Badge
Examples
With link
You can use asChild prop on <Badge /> to make another element styled as a badge.
Custom color
You can use the className prop to add custom colors to the badge.
IndigoPinkSkyPurple
With icon
You can add icons to badges to provide visual context.
Favorite
With spinner
You can add a <Spinner /> to badges to indicate loading states.
DeletingGenerating
With count
Badges can display counts or numbers for notifications and indicators.
3
API Reference
Badge
Root element of the badge. Renders a span
| Prop | Type | Default |
|---|---|---|
variant | solid, secondary, outline, success, info, warning, destructive | solid |
size | sm, md, lg | md |
className | string | - |