BadgeBadge component to display concise information.
The Badge component is used to highlight information or indicate status in a concise manner.
Install the component from your command line.
The
The Badge component supports three sizes to accommodate various layout requirements. Default size is
Badges can include an icon to provide additional visual context. By default there is no icon.
The Badge component includes screen reader support through the
Here are some common use cases for the Badge component:
AccentWarningDangerSuccessNeutralGradient
npm install @raystack/apsara
import { Badge } from '@raystack/apsara/v1' <Badge variant="accent" size="micro">Badge Text</Badge>
Badge
component accepts the following props:
variant
: Visual style variant ("accent"
|"warning"
|"danger"
|"success"
|"neutral"
|"gradient"
, default: "accent")size
: Size of the badge ("micro"
|"small"
|"regular"
, default: "small")icon
: Optional ReactNode to display an icon before the textscreenReaderText
: Additional text content only announced to screen readerschildren
: Text content of the badgeclassName
: Additional CSS class names
accent
.
loading...
small
.
loading...
loading...
screenReaderText
prop, only be announced to screen readers. By default no text is passed to screenReaderText
prop.
loading...
loading...