Badge
Badges are used to draw attention to content.
import {QBadge} from "@qui/react"
Examples
Styles
Use the kind property to alter the look and feel.
SquareRoundDot
NEW
42
import {ReactNode} from "react"import {QBadge} from "@qui/react"export default function Kind(): ReactNode {return (<div className="grid justify-center py-4"><div className="grid grid-cols-3 gap-x-8 gap-y-4"><span className="text-primary q-font-heading-xs">Square</span><span className="text-primary q-font-heading-xs">Round</span><span className="text-primary q-font-heading-xs">Dot</span><QBadge color="brand">NEW</QBadge><QBadge color="brand" kind="counter">42</QBadge><QBadge color="brand" kind="dot" /></div></div>)}
Sizes
Customize the size using the size input: provide s
, m
, or l
. The default size is m
.
TextCounterIconDot
TEXT
42
TEXT
42
TEXT
42
Colors
Choose a color to indicate different statuses. For example, positive
typically indicates success and negative
indicates failure. Use emphasis to set the emphasis of the available colors. The available options are standard
(default) and subtle
.
StandardSubtlebrand
NEW
NEW
redNEW
NEW
orangeNEW
NEW
yellowNEW
NEW
kiwiNEW
NEW
greenNEW
NEW
tealNEW
NEW
blueNEW
NEW
purpleNEW
NEW
fuchsiaNEW
NEW
magentaNEW
NEW
neutralNEW
NEW
neutral-darkNEW
NEW
positiveNEW
NEW
warningNEW
NEW
negativeNEW
NEW
informativeNEW
NEW
API
Props
Name & Description | Option(s) | Default |
---|---|---|
The component used for the root node. It can be a React component or
element. |
| 'div' |
Text content of the badge. | ReactNode | |
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element. |
| |
The style variant of the badge. |
| |
If true, the badge will render in the disabled style. |
| false |
The color emphasis of the badge. |
| "standard" |
The lucide icon of the badge. |
| |
The placement of the icon relative to the text. |
| 'end' |
The kind of the badge. |
| "text" |
The size of the badge |
| "m" |
The style global attribute
contains CSS styling
declarations to be applied to the element. | CSSProperties |
Type
| ElementType| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or
element.
Type
string
Description
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element.
Type
| 'brand'| 'red'| 'orange'| 'yellow'| 'kiwi'| 'green'| 'teal'| 'blue'| 'purple'| 'fuchsia'| 'magenta'| 'neutral'| 'neutral-dark'| 'positive'| 'warning'| 'negative'| 'informative'
Description
The style variant of the badge.
Type
boolean
Default
false
Description
If true, the badge will render in the disabled style.
Type
| 'standard'| 'subtle'
Default
"standard"
Description
The color emphasis of the badge.
Type
| LucideIcon| ReactNode
Description
The lucide icon of the badge.
Type
| 'start'| 'end'
Default
'end'
Description
The placement of the icon relative to the text.
Type
| 'text'| 'counter'| 'icon'| 'dot'
Default
"text"
Description
The kind of the badge.
Type
| 's'| 'm'| 'l'
Default
"m"
Description
The size of the badge
Type
CSSProperties
Description
The style global attribute
contains CSS styling
declarations to be applied to the element.