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

Ai Message

smoothui-registry/ai-message
FreeComponent

Chat message bubble whose action row slides out of the bubble's own edge, revealed on hover and on focus.

Install it

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

Source

index.tsxwww.smoothui.dev/r/ai-message.json · first 6 KB
1"use client";
2
3import { cn } from "@/lib/utils";
4import { Check, Copy, RotateCcw, ThumbsDown, ThumbsUp } from "lucide-react";
5import { type ReactNode, useEffect, useState } from "react";
6
7const COPIED_RESET_MS = 1600;
8const ACTION_STAGGER_MS = 30;
9
10/**
11 * The reveal is CSS so it needs no state and cannot desync from the pointer.
12 * `motion`'s `animate` target was not being re-applied on state change here, and
13 * a hover fade does not need a spring — a 200ms ease-out is the whole effect.
14 */
15const ACTION_STYLES = `
16.ai-message-action {
17 opacity: 0;
18 transform: translateX(var(--ai-message-slide)) scale(0.9);
19 transition:
20 opacity 200ms cubic-bezier(.23, 1, .32, 1),
21 transform 200ms cubic-bezier(.23, 1, .32, 1),
22 background-color 150ms ease,
23 color 150ms ease;
24}
25.ai-message-action-agent { --ai-message-slide: -6px; }
26.ai-message-action-user { --ai-message-slide: 6px; }
27.ai-message-root:hover .ai-message-action,
28.ai-message-root:focus-within .ai-message-action {
29 opacity: 1;
30 transform: translateX(0) scale(1);
31}
32.ai-message-pop { animation: ai-message-pop 250ms cubic-bezier(.23, 1, .32, 1); }
33@keyframes ai-message-pop {
34 0% { transform: scale(1); }
35 45% { transform: scale(1.25); }
36 100% { transform: scale(1); }
37}
38@media (prefers-reduced-motion: reduce) {
39 .ai-message-action { transition-duration: 0ms; transition-delay: 0ms !important; transform: none; }
40 .ai-message-root:hover .ai-message-action,
41 .ai-message-root:focus-within .ai-message-action { transform: none; }
42 .ai-message-pop { animation: none; }
43}
44`;
45
46export type AIMessageAuthor = "user" | "assistant";
47
48export type AIMessageProps = {
49 /** Rendered to the side of the bubble — an avatar or an orb. */
50 avatar?: ReactNode;
51 /**
52 * Draw the tinted bubble. Turn it off for assistant turns that carry their own
53 * surfaces — reasoning traces, tool calls, diffs — where a bubble around a
54 * stack of cards reads as a box inside a box.
55 */
56 bubble?: boolean;
57 children: ReactNode;
58 className?: string;
59 /** Plain text handed to the clipboard. Omit to hide the copy action. */
60 copyText?: string;
61 /**
62 * Who wrote it. Named `from` rather than `role` on purpose: `role` is an ARIA
63 * attribute, and a component prop of that name misleads both readers and
64 * accessibility linters.
65 */
66 from?: AIMessageAuthor;
67 onRetry?: () => void;
68 onVote?: (vote: "up" | "down") => void;
69 /** Preformatted timestamp, e.g. "14:32". */
70 timestamp?: string;
71};
72
73/**
74// … 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
yesterday

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