QUI React

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
red
NEW
NEW
orange
NEW
NEW
yellow
NEW
NEW
kiwi
NEW
NEW
green
NEW
NEW
teal
NEW
NEW
blue
NEW
NEW
purple
NEW
NEW
fuchsia
NEW
NEW
magenta
NEW
NEW
neutral
NEW
NEW
neutral-dark
NEW
NEW
positive
NEW
NEW
warning
NEW
NEW
negative
NEW
NEW
informative
NEW
NEW

API

Props

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
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
string
The style variant of the badge.
| 'brand'
| 'red'
| 'orange'
| 'yellow'
| 'kiwi'
| 'green'
| 'teal'
| 'blue'
| 'purple'
| 'fuchsia'
| 'magenta'
| 'neutral'
| 'neutral-dark'
| 'positive'
| 'warning'
| 'negative'
| 'informative'
If true, the badge will render in the disabled style.
boolean
false
The color emphasis of the badge.
| 'standard'
| 'subtle'
"standard"
The lucide icon of the badge.
| LucideIcon
| ReactNode
The placement of the icon relative to the text.
  • start: the icon is placed left of the content.
  • end: the icon is placed to the right of the content.
| 'start'
| 'end'
'end'
The kind of the badge.
| 'text'
| 'counter'
| 'icon'
| 'dot'
"text"
The size of the badge
| 's'
| 'm'
| 'l'
"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.
Description
Text content of the badge.
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.
  • start: the icon is placed left of the content.
  • end: the icon is placed to the right of the content.
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
Description
The style global attribute contains CSS styling declarations to be applied to the element.