Thinking
Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/thinking-state.json
When to use
Present a readable trace of an agent's reasoning steps, searches or code operations.
Key props and data
| Native prop | Meaning |
|---|---|
variant | Steps, Reasoning, Search or Coding chooses the native presentation. |
rows | Trace entries use primary and optional secondary, mono, add, del and href fields. |
active | Header wording while the demo advances. |
done | Header wording after the timed trace settles. |
onSettled | Notification when the local trace animation settles. |
Interaction and state checks
Supply user-facing summaries rather than confidential internal reasoning. Verify row expansion and links; retain the native timer lifecycle.
Integration boundaries
This is a timed trace UI, not an execution stream. onSettled does not certify that a server-side tool succeeded.
The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.
Runnable usage
Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.
import Demo from '@/components/beautiful-ui/examples/presets/thinking-state-custom-trace';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }
Preview states
Steps, Reasoning, Search, Coding, Custom trace
Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.
Expandable traces — steps, reasoning, search, coding.
Complete example installation
These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.
Steps
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/thinking-state/thinking-state-steps.json
Default import: @/components/beautiful-ui/examples/presets/thinking-state-steps
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Reasoning
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/thinking-state/thinking-state-reasoning.json
Default import: @/components/beautiful-ui/examples/presets/thinking-state-reasoning
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Search
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/thinking-state/thinking-state-search.json
Default import: @/components/beautiful-ui/examples/presets/thinking-state-search
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Coding
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/thinking-state/thinking-state-coding.json
Default import: @/components/beautiful-ui/examples/presets/thinking-state-coding
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Custom trace
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/thinking-state/thinking-state-custom-trace.json
Default import: @/components/beautiful-ui/examples/presets/thinking-state-custom-trace
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.
Source-backed parameter reference
Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.
ThinkingState({
variant = "Steps",
onSettled,
rows,
active,
done,
icon,
}: {
variant?: string;
onSettled?: () => void;
/** override the built-in trace content (keeps the primitive reusable) */
rows?: Row[];
active?: string;
done?: string;
/** override the header glyph (defaults to the sparkle) */
icon?: ReactNode;
})
type Row = {
primary: string;
secondary?: string;
mono?: boolean;
add?: number;
del?: number;
href?: string;
};
Destructuring defaults in source
Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.
// ThinkingState
variant = "Steps"
Native and external types
External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.
ReactNode