Components
Badge
A compact label chip with variant styles for status, category, and feedback indicators.
Installation
Install the registry item directly, then add any package dependencies if you are setting the component up manually.
Install the component
Run the registry command below to add badge to your project.
watermelon add badgeInstall manual dependencies
If you are wiring the component manually, install the package dependencies shown below.
npm install class-variance-authorityImport the component
Import Badge from your local UI registry output.
Import
import { Badge } from "@/components/ui/badge";Import
Import
import { Badge } from "@/components/ui/badge";
import { Text } from "@/components/ui/text";Usage
The Badge component composes a View wrapper and a Text child via the TextClassContext for seamless variant-matched text styles.
Variants
Choose from default, secondary, destructive, and outline.
With Status Text
Use badges inline to indicate statuses on list items or cards.
API Reference
Badge extends View props and adds a variant prop for visual style.
| prop | type | default | description |
|---|---|---|---|
| variant | "default" | "secondary" | "destructive" | "outline" | "default" | Controls the background, border, and text color of the badge. |
| children | ReactNode | - | Content inside the badge — typically a Text component. |
| className | string | - | Extends the NativeWind classes applied to the badge container. |