Skip to content

DocsAIReasoning

PT

AI

Reasoning

Reasoning block that writes, counts the time and collapses at the end.

data-u="ai-thinking"Demo

Example

Compare three component libraries for me.

The user wants to compare three component libraries. First I list the criteria: size, accessibility and license. Then I cross-check the sources and put together a short table with the final recommendation.

Collapsible reasoning

The agent's thinking arrives word by word and collapses when it's done.

Installation

Reasoning ships in the full package, along with the skill:

curl -fsSL unslop.leallabs.dev/i | sh

The example HTML, to paste:

curl -fsSL unslop.leallabs.dev/i | sh -s add ai-thinking

Uses The block is just HTML. The CSS and JS come from the full package's unslop.css and unslop.js.

Classes and variants

ClassWhat it does
.u-ai-thinkThe block.
.u-ai-think__headButton that opens and closes, with the time in __time.
.u-ai-think__body[data-open]Body, with __inner and __text.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
.u-ai-card__panelrole="group" and aria-labelSays it's a demo and of what.
headeraria-expandedOpen or collapsed. Clicking toggles it.

Keyboard

KeyDoes
Tabfocuses the header and pauses the animation
Enter or Spaceopens and collapses

Motion

Plays on its own when it enters the viewport, for up to 3 cycles, and stops in its final state. Hovering or focusing inside pauses it. With reduced motion, it shows the final state right away.

Events and API

No public events. For a real chat, copy the markup and wire up your own state, without relying on data-u for logic.

Type to search. Arrows pick, Enter opens.