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.
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.
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
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:
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.
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.