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

Ai Citation

smoothui-registry/ai-citation
FreeComponent

Inline citation pill that opens an origin-aware source card, anchored to the pill it came from.

Install it

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

Source

index.tsxwww.smoothui.dev/r/ai-citation.json
1"use client";
2
3import { cn } from "@/lib/utils";
4import { ArrowUpRight, Globe } 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};
13/** Grace period so the pointer can cross the gap between pill and card. */
14const CLOSE_DELAY_MS = 120;
15const CARD_WIDTH_PX = 288;
16
17export type AICitationProps = {
18 className?: string;
19 /** Excerpt or description shown in the card. */
20 description?: string;
21 /**
22 * The source's mark for the card header — a real isotype or an `<img>`.
23 *
24 * A node rather than a URL so a brand's own SVG can be passed straight in.
25 */
26 favicon?: ReactNode;
27 /** The number or short label shown in the pill. */
28 label: string | number;
29 title: string;
30 url: string;
31};
32
33const hostOf = (url: string): string => {
34 try {
35 return new URL(url).hostname.replace(/^www\./, "");
36 } catch {
37 return url;
38 }
39};
40
41/**
42 * An inline citation that can be peeked at.
43 *
44 * The card scales up **from the pill** rather than fading in centred: with a
45 * transform origin at the bottom of the marker, the growth points back at what
46 * was clicked, so the pointer never loses the thread. It opens on hover and on
47 * focus, and closes on Escape — a hover-only preview is unreachable by keyboard
48 * and unusable on touch.
49 */
50const AICitation = ({
51 className,
52 description,
53 favicon,
54 label,
55 title,
56 url,
57}: AICitationProps) => {
58 const shouldReduceMotion = useReducedMotion();
59 const [isOpen, setIsOpen] = useState(false);
60 const closeTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
61
62 const open = () => {
63 if (closeTimeoutRef.current) {
64 clearTimeout(closeTimeoutRef.current);
65 closeTimeoutRef.current = null;
66 }
67 setIsOpen(true);
68 };
69
70 const scheduleClose = () => {
71 closeTimeoutRef.current = setTimeout(
72 () => setIsOpen(false),
73 CLOSE_DELAY_MS
74 );
75 };
76
77 useEffect(
78 () => () => {
79 if (closeTimeoutRef.current) {
80 clearTimeout(closeTimeoutRef.current);
81 }
82 },
83 []
84 );
85
86 useEffect(() => {
87 if (!isOpen) {
88 return;
89 }
90 const handle = (event: KeyboardEvent) => {
91 if (event.key === "Escape") {
92 setIsOpen(false);
93 }
94 };
95 window.addEventListener("keydown", handle);
96 return () => window.removeEventListener("keydown", handle);
97// … 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 Context Meterai-context-meterSmoothUI RegistryComponentsFree2 deps
Ai Conversationai-conversationSmoothUI 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