Skip to main content

Badge

Badge is a small status indicator for displaying counts, labels, and categories.

Open in Storybook

Import​

import { Badge } from "@tosui/react";

Basic usage​

Color schemes​

GrayPrimaryAccentSuccessWarningErrorInfo

Variants​

SubtleSubtleSubtle
SolidSolidSolid

Sizes​

SmallMedium

Common patterns​

Status indicator​

ActivePendingInactive

Count badge​

599+

Tags​

<HStack gap={2}>
<Badge>React</Badge>
<Badge>TypeScript</Badge>
<Badge>CSS Modules</Badge>
</HStack>

With text​

<HStack gap={2} align="center">
<Text>Order Status:</Text>
<Badge colorScheme="success">Shipped</Badge>
</HStack>

Props reference​

PropTypeDefaultDescription
colorScheme"gray" | "primary" | "accent" | "success" | "warning" | "error" | "info""gray"Color scheme
variant"solid" | "subtle""subtle"Visual variant
size"sm" | "md""md"Badge size
classNamestring-Additional CSS class
childrenReactNode-Badge content

TypeScript​

import { Badge, type BadgeColorScheme, type BadgeVariant, type BadgeSize, type BadgeProps } from "@tosui/react";