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-conversation

Ai Conversation

smoothui-registry/ai-conversation
FreeComponent

Thread scroll container that follows the bottom only while the reader is already there, offering a jump-to-latest pill when it stops.

Install it

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

Source

index.tsxwww.smoothui.dev/r/ai-conversation.json
1"use client";
2
3import { cn } from "@/lib/utils";
4import { ArrowDown } from "lucide-react";
5import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6import {
7 type ReactNode,
8 useCallback,
9 useEffect,
10 useLayoutEffect,
11 useRef,
12 useState,
13} from "react";
14
15const SPRING_DEFAULT = {
16 bounce: 0.1,
17 duration: 0.25,
18 type: "spring" as const,
19};
20/**
21 * How close to the bottom still counts as "at the bottom".
22 *
23 * Zero would break on fractional scroll heights, and anything large would keep
24 * yanking the view down while someone is reading a few lines up.
25 */
26const BOTTOM_THRESHOLD_PX = 48;
27
28export type AIConversationProps = {
29 children: ReactNode;
30 className?: string;
31 /**
32 * Changes whenever content grows — message count, or streamed text length.
33 * Used to decide when to follow the bottom.
34 */
35 contentKey?: string | number;
36};
37
38/**
39 * Scroll container for a thread.
40 *
41 * It follows the bottom **only while the reader is already there**. Scrolling up
42 * during a stream is an explicit act — the user wants to read something — and
43 * dragging them back down is the single most common way chat UIs become
44 * unusable. When it stops following, a pill appears to offer the trip back.
45 */
46const AIConversation = ({
47 children,
48 className,
49 contentKey,
50}: AIConversationProps) => {
51 const shouldReduceMotion = useReducedMotion();
52 const viewportRef = useRef<HTMLDivElement | null>(null);
53 const [isPinned, setIsPinned] = useState(true);
54
55 const measure = useCallback(() => {
56 const viewport = viewportRef.current;
57 if (!viewport) {
58 return;
59 }
60 const distance =
61 viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight;
62 setIsPinned(distance <= BOTTOM_THRESHOLD_PX);
63 }, []);
64
65 const scrollToBottom = useCallback((behavior: ScrollBehavior) => {
66 const viewport = viewportRef.current;
67 if (!viewport) {
68 return;
69 }
70 // Element.scrollTo is missing in jsdom and in a few older engines, and it is
71 // not worth throwing over — assigning scrollTop lands in the same place,
72 // just without the smoothing.
73 if (typeof viewport.scrollTo === "function") {
74 viewport.scrollTo({ behavior, top: viewport.scrollHeight });
75 } else {
76 viewport.scrollTop = viewport.scrollHeight;
77 }
78 setIsPinned(true);
79 }, []);
80
81 // Layout effect, so the jump happens in the same frame the content grew and
82 // the reader never sees a flash of the pre-scroll position.
83 useLayoutEffect(() => {
84// … 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 Coreai-coreSmoothUI RegistryComponentsFree1 dep
Ai Diffai-diffSmoothUI RegistryComponentsFree2 deps

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