Skip to content
synccn

Reasoning

New

"Thinking…" panel for reasoning models: opens while the model thinks, shows how long it took, folds away after.

Installation

$ pnpm dlx shadcn@latest add @synccn/reasoning

First time in this project? Connect synccn with one command.

Usage

import { Reasoning } from "@/components/ui/reasoning";<Reasoning streaming={thinking}>{thoughts}</Reasoning>

API reference

Generated from the component's TypeScript types, so it always matches the code.

Reasoning

Collapsible "Thinking…" panel for reasoning models. It opens while the model thinks, shows how long it took, and folds away once the answer starts.

  • children
    React.ReactNode

    The model's reasoning text, which can grow while it streams.

  • streaming
    boolean

    Default false

    True while the model is still thinking. Opens the panel, and closes it again when thinking ends.

  • duration
    number

    How long it thought, in seconds. Measured automatically when not given.

  • defaultOpen
    boolean

    Default false

    Open at first, when not streaming.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Keyboard

  • EnterorSpaceShow or hide the reasoning

Accessibility

  • The toggle uses aria-expanded and aria-controls; once the person opens or closes it, it stops opening and closing by itself.

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-controls, aria-expanded, aria-hidden
  • Respects the reduced motion setting