Badge

Examples

Showcase

Dark Modern
PrimarySecondaryxs
1
1
sm
1
1
md
1
1
import {Fragment, ReactNode} from "react"
import {Badge, BadgeSize} from "@qui/react-vscode"
const sizes: BadgeSize[] = ["xs", "sm", "md"]
export default function BadgeShowcase(): ReactNode {
return (
<div className="text-foreground grid justify-center">
<div className="grid grid-cols-3 items-center gap-x-8 gap-y-6">
<span />
<span>Primary</span>
<span>Secondary</span>
{sizes.map((size) => (
<Fragment key={size}>
<span>{size}</span>
<Badge size={size} variant="primary">
1
</Badge>
<Badge size={size} variant="secondary">
1
</Badge>
</Fragment>
))}
</div>
</div>
)
}

API

BadgeProps

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
Text content of the badge.
ReactNode
Size of the badge.
| 'xs'
| 'sm'
| 'md'
The style variant of the badge.
| 'primary'
| 'secondary'
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Description
Text content of the badge.
Type
| 'xs'
| 'sm'
| 'md'
Description
Size of the badge.
Type
| 'primary'
| 'secondary'
Description
The style variant of the badge.