Badge
Introduction
The Badge component is a small, versatile visual element used to label, categorize, or highlight content metadata. It is commonly utilised to display statuses (such as "Success" or "Pending"), tags, or numerical counters.
Through the Page Builder CMS, content authors can quickly configure badge variants, sizes, and color palettes to perfectly fit their layout guidelines.
Usage
You can customize the appearance of badges using visual styles, custom colors, and responsive sizes.
Style Variants
The component supports multiple visual display styles to help establish visual hierarchy.
{
"type": "badge",
"text": "New Feature",
"variant": "solid",
"colorPalette": "blue"
}
Color Palettes
Choose from a wide array of theme accent colors to indicate semantic meanings.
{
"type": "badge",
"text": "Error Detected",
"variant": "solid",
"colorPalette": "red"
}
Size Options
Scale your badges from compact metadata pills to larger callout tags.
{
"type": "badge",
"text": "Large Label",
"size": "lg",
"colorPalette": "blue",
"variant": "subtle"
}
Props
The following configuration parameters are available when adding a badge block inside the Page Builder schema (content/pages/*.json).
| Parameter | Type | Default | Description |
|---|---|---|---|
type | String | - | The block identifier. Must be set to "badge". |
text | String | - | The text label content rendered inside the badge. |
variant | Select | "subtle" | The visual style treatment. Options: "solid", "subtle", "surface", "outline". |
colorPalette | Select | "green" | Semantic theme color accent. Options: "blue", "green", "red", "purple", "orange", "amber", "cyan", "slate", "gray". |
size | Select | "md" | The physical dimensions of the badge. Options: "sm", "md", "lg", "xl", "2xl". |
class | String | - | Custom CSS class overrides applied directly to the badge. |