# Badge

A small label for a status or an attribute, such as a role’s fit or a skill.

This is the HTML to build it with `dex.css`, for work outside the Dex codebase. Read https://brand.meetdex.ai/design.md first: it says how to set up a page and how to use the stylesheet. The page at https://brand.meetdex.ai/components/badge shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

A tone says what a badge means and a variant how loudly. The default is a subtle tint of its tone; with no tone it's a neutral grey pill.

```html
<span class="dex-badge">Draft</span>
<span class="dex-badge dex-badge--info">Interviewing</span>
<span class="dex-badge dex-badge--success">Offer</span>
<span class="dex-badge dex-badge--warning">Needs info</span>
<span class="dex-badge dex-badge--danger">Closed</span>
```

- **Dot**: `dex-badge--dot` with a tone is a neutral pill with the tone as a dot, for a status in a table or a dense list, where toned text on every row would be loud.
- **Solid**: `dex-badge--solid` with a tone fills it, for the one thing on a screen that must not be missed.
- **Outline**: `dex-badge--outline` is the tag for skills, facts and other metadata. It has no tone.
- **Muted**: `dex-badge--muted` quietens a neutral badge's text, for a value that matters less than the ones beside it.
- **Sizes**: `--sm` (20px, in a dense table), the default (24px) and `--lg` (30px, for tags beside body text). Use one size in a group.
- **With an icon**: a Lucide `<svg aria-hidden="true">` before the label. The badge sizes it.
- **Split in two**: two facts that belong together, such as where a match came from and when, share one badge with a divider. Once per badge.

```html
<span class="dex-badge dex-badge--outline">Referral<span class="dex-badge__divider"></span>12 Nov</span>
<span class="dex-badge dex-badge--dot dex-badge--success">Offer</span>
```

- **As a link**: `<a class="dex-badge dex-badge--outline" href="…">`, keeping the label as its text.

## Rules

- A badge is a static label: a status, a fact, a skill. It's never pressed. Something a person can press or remove is a chip (https://brand.meetdex.ai/components/chips.md), and a number on its own is a count (https://brand.meetdex.ai/components/count.md).
- Keep a tone for a real status, and give the same status the same tone everywhere. Never orange: the brand colour isn't a status.
- Colour is never the only signal: the words say what the status is.
- One or two words in sentence case, as an adjective or past tense: "Archived", not "Archive", so it doesn't read as a button.
- Never restyle a badge with your own colour, height or weight; use its options.
