Artefact UI

Search

Blog

Docs

About

Playground

MenuChevron Down

Blog

Docs

About

Playground

Badge - Docs - Artefact

Badge

Feedback
Presentational

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"
}
Solid
Subtle
Surface
Outline

Color Palettes

Choose from a wide array of theme accent colors to indicate semantic meanings.

{
  "type": "badge",
  "text": "Error Detected",
  "variant": "solid",
  "colorPalette": "red"
}
Success
Error
Warning
Special
Draft

Size Options

Scale your badges from compact metadata pills to larger callout tags.

{
  "type": "badge",
  "text": "Large Label",
  "size": "lg",
  "colorPalette": "blue",
  "variant": "subtle"
}
Small
Medium
Large
Extra Large

Props

The following configuration parameters are available when adding a badge block inside the Page Builder schema (content/pages/*.json).

ParameterTypeDefaultDescription
typeString-The block identifier. Must be set to "badge".
textString-The text label content rendered inside the badge.
variantSelect"subtle"The visual style treatment. Options: "solid", "subtle", "surface", "outline".
colorPaletteSelect"green"Semantic theme color accent. Options: "blue", "green", "red", "purple", "orange", "amber", "cyan", "slate", "gray".
sizeSelect"md"The physical dimensions of the badge. Options: "sm", "md", "lg", "xl", "2xl".
classString-Custom CSS class overrides applied directly to the badge.