Modal
Modal on native dialog. showModal() for top-layer + focus trap; Escape and backdrop close; focus returns to the opener. Enter/exit motion is CSS on --tk-motion-enter / exit (see modal.css).
Evidence
What the kit's own checks measured on this component, from their committed records. A result is what was found, not a certificate.
| Check | What it measures | Result | When |
|---|---|---|---|
| Controls | every prop reachable from a story's controls | 10 stories opened; none flagged | 2026-11-28 |
| Radius | corner radii from the kit's scale only | 10 stories opened; none flagged | 2026-11-28 |
| Attributes | only valid data-tk attributes and values | 10 stories opened; none flagged | 2026-11-28 |
| Titles | each story has a heading and a title | 10 stories opened; none flagged | 2026-11-28 |
| Accessibility (axe) | axe-core on each story, at desktop and phone width | 10 stories opened; none flagged | 2026-11-28 |
| Reflow at 320px | each story at 320px wide: no sideways scroll | 10 stories opened; none flagged | 2026-11-28 |
| Forced colours | each story in Windows high contrast | 10 stories opened; none flagged | 2026-11-28 |
| Reduced motion | each story with reduced motion: nothing keeps moving | 10 stories opened; none flagged | 2026-11-28 |
| Events (what it reports) | each event its contract declares, triggered and checked; nothing undeclared, no vendor called | 2 of 2 declared events arrive as declared | 2026-11-28 |
| Right to left | each story set right to left: nothing pushed off the page | 10 stories opened; none flagged | 2026-11-28 |
| Text 40% longer | every text made about 40% longer: no words cut, no sideways scroll | 10 stories opened; none flagged | 2026-11-28 |
| Keyboard (its contract's keys) | each key its contract promises, pressed on a fresh story | 2 keys pressed; each does what the contract says | 2026-11-28 |
| Design matches code | the Figma component laid over the rendered code, per skin | Modal: mean Δ 5.63, worst 6.94 over 3 skins; ModalDescription: mean Δ 3.15, worst 3.15 over 1 skin | 2026-10-19 |
| Figma | where it is drawn in the Figma library | 2 components in the library; Code Connect linked; 7 Figma properties paired or decided | |
| Tokens | the tk slots its CSS reads | reads 30 tk slots |
Not checked yet
- Screen-reader wording and reading order, heard by a person.
- Native platforms (no SwiftUI or Compose kit yet).
- No contrast pair is labelled with its elements; its colours are checked only through the components it uses.
Props
| Prop | Type | Required | In Figma |
|---|---|---|---|
| open | boolean | yes | not drawn |
| onClose | event | yes | not drawn |
| title | text | yes | Modal.Title |
| description | content | no | Modal.Description |
| alert | boolean | no | not drawn |
| children | content | no | Modal.Body |
| actions | other | no | not drawn |
| footer | content | no | Modal.Show footer |
| closeOnBackdrop | boolean | no | not drawn |
| dismissible | boolean | no | Modal.Dismissible |
| size | sm | md | lg | no | Modal.Size |
| returnFocusTo | other | no | not drawn |
Figma properties no prop takes
- Modal.Description text is description
Keyboard and screen readers
- Escape closes when dismissible
- Escape returns focus to the trigger
What it reports
The kit sends nothing anywhere: a component dispatches one DOM event, tk:event, and only a page that listens forwards it. Never sent: typed text, an option's label or value, names, emails.
- open: the dialog opens, with size (sm | md | lg), alert (boolean)
- dismiss: the dialog closes, and how, with how (escape | backdrop | button | app)
Tokens it reads
control-min, duration-base, focus-offset, focus-width, leading-tight, line-default, measure, measure-dialog-lg, measure-dialog-md, measure-dialog-sm, motion-enter, motion-exit, radius-nested, radius-xl, scrim-ink, shadow-lg, size-base, size-sm, size-xl, space-1, space-2, space-3, space-4, space-5, space-6, surface-raised, text-primary, text-secondary, tracking-snug, weight-semibold