BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/motiq/ai-response-stream

AI Response Stream

motiq/ai-response-stream
FreeComponent

Renders a streaming assistant response supplied by your app — text, fenced code with copy, inline [n] citations to a sources rail, and streaming/stopped/complete/error states with Stop, Retry, and Copy. Presentation only: it never calls a model. Reduced-motion shows text instantly; a polite live region announces completion, not tokens.

Live preview

live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.motiq.dev/r/ai-response-stream.json

Source

registry/ai/ai-response-stream.tsxwww.motiq.dev/r/ai-response-stream.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { motion, AnimatePresence } from "motion/react";
5
6import { cn } from "@/lib/utils";
7import { useReducedMotion } from "@/lib/motiq";
8
9/**
10 * AiResponseStream — renders a streaming assistant response supplied by the
11 * parent application (text, fenced code, inline citations, and lifecycle
12 * state). It is a *presentation* component: it never talks to a model, never
13 * fabricates tokens, and makes no claim about what an AI is "doing" — the app
14 * owns the stream and passes the segments + state in.
15 *
16 * Accessibility: the rendered content is real, readable text (not aria-hidden),
17 * so once the response is complete a screen reader reads the whole thing in one
18 * pass. A separate polite `role="status"` region announces lifecycle changes
19 * (responding / complete / stopped / failed) — never token-by-token, so the
20 * live region is not spammed. State is conveyed with icon + label + border, not
21 * colour alone, so it survives forced-colors. Stop / Retry / Copy are real
22 * <button>s with accessible names and focus-visible rings. Under
23 * `prefers-reduced-motion` there is no per-token motion and no caret: content
24 * appears immediately. Clean-room original.
25 */
26
27export type StreamState = "streaming" | "stopped" | "complete" | "error";
28
29/** A source referenced by inline `[n]` citation markers. */
30export interface StreamSource {
31 /** Stable id referenced by a `citation` segment's `sourceId` (e.g. "1"). */
32 id: string;
33 /** Human-readable title shown in the sources rail. */
34 title: string;
35 /** Optional external URL. Rendered as a real link when present. */
36 url?: string;
37 /** Optional one-line context shown under the title. */
38 snippet?: string;
39}
40
41/** Ordered content the parent streams in. Text may contain blank-line paragraph breaks. */
42export type ResponseSegment =
43 | { type: "text"; text: string }
44 | { type: "code"; code: string; lang?: string; filename?: string }
45 | { type: "citation"; sourceId: string };
46
47export interface AiResponseStreamProps {
48 /** Ordered response segments supplied by the application. */
49 segments: ResponseSegment[];
50 /** Lifecycle state, owned by the application. */
51 state: StreamState;
52 /** Sources referenced by inline citations; rendered as a numbered rail. */
53 sources?: StreamSource[];
54 /** Label shown in the header (e.g. the assistant/model display name). */
55 assistantName?: string;
56 /** Message shown in the error banner when `state === "error"`. */
57// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • https://motiq.dev/r/utils.json
  • https://motiq.dev/r/primitives.json

Files it writes

  • registry/ai/ai-response-stream.tsx

Facts

Registry
motiq
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on motiq www.motiq.dev RMahammad/motiq on GitHub Raw registry item This item as JSON

More from motiq

All 100 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Activity Streamactivity-streammotiqComponentsFree1 dep
Adaptive Safe-Zone Gridadaptive-safe-zone-gridmotiqComponentsFreeno deps
Agent Run Timelineagent-run-timelinemotiqComponentsFree1 dep
Animated Accordionanimated-accordionmotiqComponentsFree2 deps
Animated Buttonanimated-buttonmotiqComponentsFree1 dep
Animated Dialoganimated-dialogmotiqComponentsFree2 deps
Animated Gridanimated-gridmotiqComponentsFree2 deps
Animated Iconsanimated-iconsmotiqComponentsFree1 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

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.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 KitGrade

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 KitGrade

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 KitGrade

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