Skip to main content

Work

The work behind one chat answer, its reasoning and its tool calls, under one "Show work" toggle that stays open while the answer streams. When the answer ends, the work folds away, so the answer is what the reader sees.

Desktop viewport
Tablet viewport
Mobile viewport

When to use

  • Fold the reasoning and the tool calls of one chat answer under one toggle, above the answer's text.
  • Use Reasoning or Tool Call alone when an answer has one step.
  • Prefer Accordion for titled sections that are not part of a chat answer.

While it streams

Set streaming on Work.Root while the model works on the answer. The work shows, so the reader sees each step arrive, and the trigger reads "Hide work". When streaming turns off, the work folds away and the trigger reads "Show work".

The reader's choice wins. When they press the trigger, the work stays the way they left it. When they press a step while the answer streams, such as to open a tool call, or find-in-page reveals a match in one, the work stays open when the answer ends.

Desktop viewport
Tablet viewport
Mobile viewport

Carets on hover

Each step's caret shows only on hover, on keyboard focus, or while the step is open, so a column of finished steps reads as a quiet list. A touch screen has no hover, so there the caret always shows and each row is taller to tap. Work.Trigger keeps its caret at all times, because it is the one control that opens the rest.

Composition

Work.Root├── Work.Trigger└── Work.Content    ├── Reasoning.Root    └── ToolCall.Root

Polymorphism

No part takes asChild. Each one renders more than one element, or an element beside its children.

API Reference

Work.Root

The work disclosure. It is open while streaming is set, until the reader chooses.

All props from div, plus:

PropTypeDefaultDescription
streaming?booleanfalseTrue while the model works on the answer. The work shows, and folds away when it ends.
Data AttributeValueDescription
data-streamingpresent while streamingPresence-only. Style with data-streaming:.

Work.Trigger

The toggle reads "Show work" while the work is closed and "Hide work" while it is open, with a caret. It takes no children.

All props from button except type and children.

Data AttributeValueDescription
data-slot="work-trigger-label"on the wrapperThe display: contents wrapper around the label.

Work.Content

The steps of the answer in a column. A press in a step, or a find-in-page match in one, keeps the work open when the answer ends. Find-in-page reaches it while it is closed.

All props from div.