# Badges, icons, and tooltips

> Small inline components for labels, icons in running text, and terms that need a short explanation on hover.

These three sit inside a sentence rather than on their own line. Use them sparingly, so they still stand out when they appear.

## Badges

A badge is a small pill-shaped label, good for marking something as new, beta, or tied to a version.

This endpoint is <Badge>Beta</Badge> and may change before `v3`.

```mdx
This endpoint is <Badge>Beta</Badge> and may change before `v3`.
```

Put the label text between the tags. All badges share one neutral style.

## Icons

`<Icon>` drops an icon into text. It takes any [Heroicons](https://heroicons.com/) outline name, plus common alternative names like `rocket`, `gear`, and `book` that Typemark maps to a Heroicon.

Click <Icon icon="cog-6-tooth" /> **Settings**, then <Icon icon="globe-alt" color="#E8503A" size="18" /> **Domains**.

```mdx
Click <Icon icon="cog-6-tooth" /> **Settings**, then <Icon icon="globe-alt" color="#E8503A" size="18" /> **Domains**.
```

By default an icon matches the size and colour of the text around it.

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `icon` | string | none | Heroicons name. A name Typemark doesn't know renders nothing. |
| `color` | string | text colour | A hex colour like `#E8503A`, or a CSS colour name. |
| `size` | number | text size | Size in pixels. |

## Tooltips

A tooltip explains a term without breaking the sentence. The text gets a dotted underline, and the tip shows when readers hover over it.

Every request needs an <Tooltip tip="A secret string that identifies your account. Find it in your dashboard.">API key</Tooltip>.

```mdx
Every request needs an <Tooltip tip="A secret string that identifies your account. Find it in your dashboard.">API key</Tooltip>.
```

Add `headline` to put a short lead-in before the tip. The tooltip then reads "headline: tip".

Responses are cached at the <Tooltip headline="CDN" tip="Content delivery network, servers close to your readers">edge</Tooltip>.

```mdx
Responses are cached at the <Tooltip headline="CDN" tip="Content delivery network, servers close to your readers">edge</Tooltip>.
```

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `tip` | string | none | The explanation shown on hover. |
| `headline` | string | none | Text shown before the tip, followed by a colon. |

The text between the tags is the word or phrase that gets the underline.

<Callout type="tip">
  Most touch screens can't show hover tooltips. Keep anything readers must know in the text itself.
</Callout>

## In the visual editor

These components show as non-editable inline source in the visual editor and save back unchanged. To change one, edit it in source mode.
