# Callout

A note let into running text, for docs and articles: the Alert’s idea, made quiet. There is no window and no glass, only a narrow groove cut down the margin of the paragraph with one lamp seated at its head, a printed word that says what kind of note it is (Note, Tip or Caution) and the words in the text’s own ink. Quiet draws the groove as a hairline.

Kit part · Free · https://tactileui.dev/parts/callout

- Element: `<div class="tui-callout" role="note">`
- Needs: `kit.css` only, no script ([how to install the kit](https://tactileui.dev/docs/installation#the-kit))
- Covers: Callout, Note
- Categories: Alerts
- Finishes: Aluminium, Graphite, Oak, Walnut, Porcelain, Black, Daylight, Night, Paper, Phosphor, E-paper, AMOLED
- Volumes: Tactile, Quiet

## Variants

### Note · white lamp

```html
<div style="width:min(100%,360px)"><div class="tui-callout" role="note" aria-labelledby="co5"><span class="tui-lamp" data-lamp="white" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co5">Note</p><p>Exports are kept for 30 days.</p></div></div>
```

### Tip · green lamp

```html
<div style="width:min(100%,360px)"><div class="tui-callout" role="note" aria-labelledby="co6"><span class="tui-lamp" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co6">Tip</p><p>Press <b>?</b> anywhere to see every shortcut.</p></div></div>
```

### Caution · amber lamp

```html
<div style="width:min(100%,360px)"><div class="tui-callout" role="note" aria-labelledby="co7"><span class="tui-lamp" data-lamp="amber" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co7">Caution</p><p><b>This cannot be undone.</b> The project and its exports are deleted together.</p></div></div>
```

### Your own heading after the word

```html
<div style="width:min(100%,360px)"><div class="tui-callout" role="note" aria-labelledby="co8"><span class="tui-lamp" data-lamp="white" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co8">Note: before you upgrade</p><p>Version 4 reads settings from a new place. Your old file is kept beside it.</p></div></div>
```

### More than one paragraph and a list

```html
<div style="width:min(100%,360px)"><div class="tui-callout" role="note" aria-labelledby="co9"><span class="tui-lamp" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co9">Tip</p><p>Name an endpoint for what it does:</p><ul style="margin:0;padding-left:18px"><li>orders-live</li><li>orders-test</li></ul><p>You can rename it later.</p></div></div>
```

### As an aside

```html
<div style="width:min(100%,360px)"><aside class="tui-callout" aria-labelledby="co10"><span class="tui-lamp" data-lamp="white" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co10">Note</p><p>This note stands beside the text, so it is an aside.</p></aside></div>
```

## Every state

- Note
- Tip
- Caution

Hover, pressed and focus are forced with `.is-hover`, `.is-down` and `.is-focus`; checked and disabled are real.

## API

| Name | Kind | Values | What it does |
| - | - | - | - |
| .tui-callout[role="note"][aria-labelledby] | element | div or aside | The note. A div with role="note" and a name for most notes, an aside only where it really stands beside the text. It is not a landmark. |
| .tui-callout > .tui-lamp[data-lamp] | element | white · green · amber | The lamp seated in the groove, hidden from a screen reader. White for a note, green for a tip, amber for a caution. |
| .tui-label.tui-callout__title | element | the kind, in words | The printed word: Note, Tip or Caution, which is also the note’s name. Add your own words after it if you like; keep the kind word first. |
| p, ul, ol, pre inside | content | any text | The note itself, in the text’s ink at its own size. Put what matters first, in . |

## Markup

```html
<!-- A note in the margin of the text. role="note" and a name, not a landmark. -->
<div class="tui-callout" role="note" aria-labelledby="co-1">
  <span class="tui-lamp" data-lamp="amber" data-on aria-hidden="true"></span>
  <p class="tui-label tui-callout__title" id="co-1">Caution</p>
  <p>Deleting a project also deletes its exports. <b>This cannot be undone.</b></p>
</div>

<!-- Or an aside, where the note really is beside the text: -->
<aside class="tui-callout" aria-labelledby="co-2">…</aside>
```

The demo on the page:

```html
<article style="width:min(100%,600px);text-align:left;display:grid;gap:4px"><h3 class="tui-h3" style="margin-bottom:8px">Adding a webhook in Lode</h3>
  <p style="margin:0;color:var(--tui-ink-2)">Open <b>Settings</b>, then <b>Webhooks</b>, and press <b>Add endpoint</b>. Paste the address Northwind gave you and choose the events you want to hear about.</p>
  <div class="tui-callout" role="note" aria-labelledby="co2"><span class="tui-lamp" data-lamp="white" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co2">Note</p><p>Each endpoint gets its own signing secret. It is shown once, so copy it before you close the box.</p></div>
  <p style="margin:0;color:var(--tui-ink-2)">Lode sends a test event when you save. A green tick beside the endpoint means your server answered with a 200.</p>
  <div class="tui-callout" role="note" aria-labelledby="co3"><span class="tui-lamp" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co3">Tip</p><p>Use a different endpoint for each environment, so a test never reaches the live system.</p></div>
  <div class="tui-callout" role="note" aria-labelledby="co4"><span class="tui-lamp" data-lamp="amber" data-on aria-hidden="true"></span><p class="tui-label tui-callout__title" id="co4">Caution</p><p><b>Do not put the signing secret in your page source.</b> Anyone who can read it can send events that look like ours.</p></div>
  <p style="margin:0;color:var(--tui-ink-2)">If your server is slow, Lode retries a failed event three times over an hour.</p></article>
```

## Usage notes

The three kinds sit in the text of a short guide. Read it with the lamps in mind: the word at the head of each note says what it is, so the lamp is only a second sign.

## Accessibility

- The kind is said in words. The title is the note’s accessible name (`aria-labelledby`), so a screen reader says “Caution, note” before the text; the lamp is hidden and only agrees with the word.
- `role="note"` is for exactly this: ancillary content in a document. It is not a landmark, so a long article with a dozen notes does not fill the page’s landmark list.
- The title is a paragraph, not a heading, so the notes do not appear in the document outline. Use a real heading only when the note is a section of its own.
- The title in `--tui-ink-2` and the text in full ink are both above 4.5:1 on the page; the groove is decoration and carries no meaning.
- Nothing moves and nothing takes focus. Links inside the note are the kit’s links, with their own ring.

## How it’s built

A paragraph with a groove cut down its left edge: a 10px pill in the kit’s recess, which in Quiet becomes a hairline outline. The lamp is the kit’s own, placed over the head of the groove. The title is the printed label the kit uses for panel heads. There is no box, so the note takes the width of the text it sits in and never pushes the page sideways.

## Rules

Set a side remark into an article without breaking the page: a groove, a lamp and a word say what kind of note it is, and the sentence says the rest.

The full rules are in `callout.rules.md` in the brain, which ships with the Kit.

## Related parts

- [Alert](https://tactileui.dev/parts/alert): A message let into the surface, with an annunciator: a small lit legend (Note, Done, Check, Fault) beside the words that say what happened.
- [Lamp](https://tactileui.dev/parts/lamp): The only colour in the kit: a lamp that is on. Green is on, amber is waiting, red is recording or failing, blue is linked, white is standing by. Always next to words.
- [Divider with label](https://tactileui.dev/parts/divider-label): A rule with a word set into it. The same engraved groove as the separator runs out to both sides of a printed word, broken where the word sits: “or” between two ways in, a date between two days of messages, the name of the section below. The word is real text in reading order; only the two grooves are drawn.
