--- title: Badge description: A small label for counts, statuses, or short metadata. --- ## Preview ## Installation CLI Manual ```bash npx @olyx/cli@latest add badge ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Badge } from "@/components/ui/badge" ``` ```tsx Badge ``` ## Link You can use the [`render`](https://base-ui.com/react/utils/use-render#migrating-from-radix-ui) prop to make another component look like a badge. Here's an example of a link that looks like a badge. ```tsx import Link from "next/link" import { Badge } from "@/components/ui/badge" export function LinkAsBadge() { return }>New } ``` ## API Reference ### Badge A badge component using Base UI's `useRender` hook for flexible rendering. | Prop | Type | Default | | ---------- | ------------------------------------------------ | ----------- | | `variant` | `"primary"` | `"primary"` | | `mode` | `"filled" \| "light" \| "lighter" \| "stroke"` | `"lighter"` | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `shape` | `"rounded" \| "smoothed"` | `"smoothed"`| | `doted` | `boolean` | `false` | | `disabled` | `boolean` | `false` | | `render` | `React.ReactElement` | - | ## Examples ### Modes ### Sizes ### Shapes ### With Dot ### With Icon ### Disabled