# Reasoning

The model’s working, printed on a paper tape that feeds behind a smoked window. While it thinks, an amber lamp is lit beside “Thinking” and an LCD counts the seconds.

Kit part · With the Kit · https://tactileui.dev/parts/reasoning

> The code and styling for this part come with the Tactile UI Kit, which is in the Founder Pass. Sign in if you have it. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

The window is a recess whose padding is its frame; the tape is the content box, painted as the kit’s thermal paper with a column of punched holes down its left edge. Steps sit on an engraved rail, each lamp ringed with paper so the rail stops short of it.

## Variants

- Done · closed, as history
- Opened by hand · the tape
- Chain of thought · a failed step
- Stopped
- Hidden by the provider

## States

- Thinking
- Done
- Opened by hand
- Stopped
- Hidden
- Focus

## Props and options

| Name | Kind | Description |
| - | - | - |
| label | attribute | The name the head is read by. |
| state | attribute | Set on history rendered later; start(), end() and stop() set it while streaming. |
| duration | attribute | How long it thought, for history. end() writes it. |
| auto-close | attribute | On by default: the window folds away when the thinking ends, unless the reader opened it. |
| closed · open · still | attribute | closed keeps the window shut while it thinks; open shows history open; still holds a thinking specimen’s clock at its duration. |
| demo | attribute | Plays about eight seconds of thinking with three steps, for static pages. |
| paused | attribute | Holds a demo where it is: nothing more is written and the clock stops. Take it off to carry on from there. |
| start() · write(text) · end() · stop() | method | Stream the working. A blank line in write() starts a paragraph. |

## Usage notes

It thinks for about eight seconds, stamps three steps, then folds itself away. Open it while it thinks and it stays open. Play it again with the key below.

## Accessibility

- The tape is not a live region.
- Each step’s lamp has a spoken name (running, done, failed), so the colour is never the only signal.
- Folding away never takes the tape from a reader who opened it: auto-close only shuts what it opened itself.
- Under reduced motion the tape does not feed and the window does not slide; the timer still counts, because the time is information.

## Related parts

- [Chat](https://tactileui.dev/parts/chat): An AI chat as a teleprinter, with restraint: what you type sits in a recess; the answer prints on a perforated slip with an amber lamp at the print head; code comes up on display glass. Composer with attachments and a send key that becomes Stop.
- [Timeline](https://tactileui.dev/parts/timeline): An event log like the roll of a chart recorder. The rail is engraved down the plate and each event is a tick stamped across it, with its time in tabular figures and its words beside it. A lamp on the rail is the only colour, and a marker for the present separates what has happened from what is still to come.
- [Accordion](https://tactileui.dev/parts/accordion): Printed sections that open in place. Each head ends in a small square key printed +; open, the key latches below the plate and reads −.
