BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/SmoothUI Registry/ai-reasoning

Ai Reasoning

smoothui-registry/ai-reasoning
FreeComponent

Collapsible AI reasoning trace that shimmers only while the model works, reports how long it took and gets out of the way.

Install it

npx shadcn@latest add https://www.smoothui.dev/r/ai-reasoning.json

Source

index.tsxwww.smoothui.dev/r/ai-reasoning.json
1"use client";
2
3import { cn } from "@/lib/utils";
4import { ChevronRight } from "lucide-react";
5import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6import { type ReactNode, useEffect, useRef, useState } from "react";
7
8const SPRING_DEFAULT = {
9 bounce: 0.1,
10 duration: 0.25,
11 type: "spring" as const,
12};
13const EASE_OUT = [0.23, 1, 0.32, 1] as const;
14/**
15 * A beat before auto-collapsing. Snapping shut the instant the trace finishes
16 * makes it feel like the content was yanked away mid-read.
17 */
18const AUTO_COLLAPSE_DELAY_MS = 600;
19const MS_PER_SECOND = 1000;
20const SHIMMER_SECONDS = 1.8;
21
22export type AIReasoningProps = {
23 children: ReactNode;
24 className?: string;
25 /**
26 * Collapse itself once `isStreaming` goes false. The trace is scaffolding —
27 * interesting while it happens, clutter once the answer has landed.
28 */
29 collapseWhenDone?: boolean;
30 /** Start expanded. */
31 defaultOpen?: boolean;
32 /** Seconds the model spent. Omit to have the component time it itself. */
33 duration?: number;
34 isStreaming?: boolean;
35};
36
37/**
38 * Collapsible reasoning trace.
39 *
40 * The summary line shimmers only while the model is actually working, so the
41 * shimmer means something rather than being decoration. When the trace ends it
42 * settles, reports how long it took, and gets out of the way.
43 */
44const AIReasoning = ({
45 children,
46 className,
47 collapseWhenDone = true,
48 defaultOpen,
49 duration,
50 isStreaming = false,
51}: AIReasoningProps) => {
52 const shouldReduceMotion = useReducedMotion();
53 const [isOpen, setIsOpen] = useState(defaultOpen ?? isStreaming);
54 // Once someone opens or closes it by hand, stop deciding for them.
55 const [isUserControlled, setIsUserControlled] = useState(false);
56
57 const startedAtRef = useRef<number | null>(null);
58 const [measuredSeconds, setMeasuredSeconds] = useState<number | null>(null);
59
60 useEffect(() => {
61 if (isStreaming) {
62 startedAtRef.current = Date.now();
63 setMeasuredSeconds(null);
64 if (!isUserControlled) {
65 setIsOpen(true);
66 }
67 return;
68 }
69 if (startedAtRef.current !== null) {
70 setMeasuredSeconds((Date.now() - startedAtRef.current) / MS_PER_SECOND);
71 startedAtRef.current = null;
72 }
73 }, [isStreaming, isUserControlled]);
74
75 useEffect(() => {
76 if (isStreaming || !collapseWhenDone || isUserControlled) {
77 return;
78 }
79 const timeout = setTimeout(() => setIsOpen(false), AUTO_COLLAPSE_DELAY_MS);
80 return () => clearTimeout(timeout);
81// … truncated

What it pulls in

npm packages

  • lucide-react
  • motion

Files it writes

  • index.tsx

Facts

Registry
SmoothUI Registry
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

www.smoothui.dev educlopez/smoothui on GitHub Raw registry item This item as JSON

More from SmoothUI Registry

All 178 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Agent Avataragent-avatarSmoothUI RegistryComponentsFreeno deps
Ai Approvalai-approvalSmoothUI RegistryComponentsFree2 deps
Ai Artifactai-artifactSmoothUI RegistryComponentsFree2 deps
Ai Branchai-branchSmoothUI RegistryComponentsFree2 deps
Ai Citationai-citationSmoothUI RegistryComponentsFree2 deps
Ai Context Meterai-context-meterSmoothUI RegistryComponentsFree2 deps
Ai Conversationai-conversationSmoothUI RegistryComponentsFree2 deps
Ai Coreai-coreSmoothUI RegistryComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex