Skip to content
Calm motion: animations on this site only fade, with no movement

Reasoning ​

The thinking of a model, in a panel that folds

Shows the reasoning of a model above its reply. While the model thinks, the panel is open and the head says "Thinking…". At the end, the panel closes and the head says how long the model thought. For a call to a tool, use the tool call.

Basic
Thought for 8 s
The user wants the show notes as a list. I will keep the links and drop the ads.
  • Give the text so far in text, or put your own content in the default slot. The text keeps its line breaks.
  • Set streaming while the model thinks. A soft light runs over the head, and the body has aria-busy. If the reader asks for less motion, the light does not run.
  • If the reader does not touch the panel, it opens when the model starts and closes at the end. A reader who opens or closes the panel keeps that choice.
  • The time is the time that streaming was on. For a reply from the history, give the time in seconds with duration. With no time, the head says "Reasoning".
  • v-model:open reads or sets the state of the panel.
  • The panel is a native details element, so the keyboard and screen readers know it. Change the words with labels or a label pack: thinking, thought (a function of the seconds), and done.

Usage ​

ts
import { BlessReasoning } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
textstring—the reasoning text so far; or put it in the default slot
streamingboolean—the model is still thinking: the panel is open and the head says so
durationnumber—how long the model thought, in seconds; default: the time it was streaming
labelsPartial<{ thinking: string; thought: (seconds: number) => string; done: string; }>—
openboolean—open while it streams, and it closes at the end unless the reader opened or closed it

Events

NamePayloadDescription
update:open[value: boolean | undefined]

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.