# Follow-ups

Questions that an answer opens, in a muted block under the question that opened them.

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/follow-ups shows the Dex app's own React component, which only works inside the Dex codebase.

## HTML

`dex.css` has no follow-ups class: the block is a few lines of layout on its own tokens, holding ordinary fields.

```html
<fieldset class="dex-form-row" style="border: 0; margin: 0; padding: 0">
  <legend class="dex-field-label">Open to hybrid?</legend>
  <div style="display: flex; gap: 0.5rem">
    <button class="dex-chip" aria-pressed="true">Yes</button>
    <button class="dex-chip" aria-pressed="false">No</button>
  </div>
</fieldset>

<div style="display: flex; flex-direction: column; gap: 1.5rem; margin-top: 0.75rem; padding: 1rem;
            border-radius: var(--dex-radius-lg); background: var(--dex-muted)">
  <fieldset class="dex-form-row" style="border: 0; margin: 0; padding: 0">
    <legend class="dex-field-label">Up to how many days a week in the office?</legend>
    <div style="display: flex; flex-wrap: wrap; gap: 0.5rem">
      <button class="dex-chip" aria-pressed="false">1 day</button>
      <button class="dex-chip" aria-pressed="false">2 days</button>
      <button class="dex-chip" aria-pressed="true">3 days</button>
      <button class="dex-chip" aria-pressed="false">4 days</button>
    </div>
  </fieldset>
</div>
```

- **Several questions**: more fields in the same block, 24px apart (its `gap`).
- **With close**: when a link or button opened the block rather than an answer, add a ghost icon button (`dex-button dex-button--ghost`, `aria-label="Close"`, a Lucide `x`) at its top right, with `position: absolute` and `position: relative` on the block, and room for it beside the first label.
- **Invalid**: each question shows its own error, as it would outside the block: `aria-invalid="true"` and a `dex-field-error`.

## Rules

- Put the block right under the question whose answer opened it, 12px below, and take it away when that answer changes.
- One block holds everything the answer opens, such as where someone would move to and whether they need support.
- Controls keep their card fill on the muted block.
- Clear the follow-up answers when the block closes.
