---
title: Badge
description: Six semantic badge variants.
---

A badge labels a short piece of content. Six variants share the semantic
color tokens with callouts.

## All variants

```ts
badge('default');
badge('gold', 'gold');
badge('info', 'info');
badge('warning', 'warning');
badge('error', 'error');
badge('success', 'success');
```

## In context

```ts
'Deploy status: ' + badge('deploying', 'info') + ' ' + badge('new', 'gold');
```

## Props

<PropsTable
  labels={{ prop: 'Option', type: 'Type', default: 'Default' }}
  type={{
    text: { type: 'string', description: 'Badge label (first argument).' },
    variant: { type: "'default' | 'gold' | 'info' | 'warning' | 'error' | 'success'", default: "'default'", description: 'Semantic variant.' },
  }}
/>

## Notes

- Variants map to `--cpd-*` semantic tokens; `gold` keeps the brand accent
  for special highlights.
- Renders as `<span class="cpd-badge cpd-badge-<variant>">`.
