BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blocks/ai-05

AI Elements Chat

blocks/ai-05
FreeBlock

A ai elements chat block.

Install it

npx shadcn@latest add https://blocks.so/r/ai-05.json

Source

content/components/ai/ai-05.tsxblocks.so/r/ai-05.json · first 6 KB
1'use client';
2
3// Install AI Elements components:
4// npx ai-elements@latest add conversation message prompt-input
5
6import {
7 IconAdjustmentsHorizontal,
8 IconBolt,
9 IconMessageCircle,
10 IconPaperclip,
11 IconRefresh,
12 IconSparkles,
13} from '@tabler/icons-react';
14import type { ChatStatus } from 'ai';
15import { useEffect, useRef, useState } from 'react';
16import {
17 Conversation,
18 ConversationContent,
19 ConversationScrollButton,
20} from '@/components/ai-elements/conversation';
21import {
22 Message,
23 MessageContent,
24 MessageResponse,
25} from '@/components/ai-elements/message';
26import {
27 PromptInput,
28 PromptInputButton,
29 PromptInputFooter,
30 PromptInputSubmit,
31 PromptInputTextarea,
32 PromptInputTools,
33} from '@/components/ai-elements/prompt-input';
34import { Badge } from '@/components/ui/badge';
35import { Button } from '@/components/ui/button';
36import { cn } from '@/lib/utils';
37
38interface DemoMessage {
39 id: string;
40 role: 'user' | 'assistant';
41 content: string;
42}
43
44const INITIAL_MESSAGES: DemoMessage[] = [
45 {
46 id: 'intro',
47 role: 'assistant',
48 content:
49 '**Welcome back.** I can help you explore this chat block.\n\n- Draft UI copy\n- Summarize docs\n- Turn notes into tasks\n\nAsk me anything and I will respond with a demo reply.',
50 },
51 {
52 id: 'question',
53 role: 'user',
54 content: 'What makes this chat block reusable?',
55 },
56 {
57 id: 'answer',
58 role: 'assistant',
59 content:
60 'It is built with **AI Elements** for conversation layout and input, plus shadcn/ui for the chrome. That means you can drop it into other screens and wire it up to a real AI backend later.',
61 },
62];
63
64const RESPONSES = [
65 'Here is a quick outline you can reuse:\n\n1. Swap the mock response with a real API call.\n2. Stream tokens into `MessageResponse`.\n3. Keep the layout exactly as-is for a consistent UI.',
66 'If you want multi-model support, add a small model selector next to the status badge and pass the selection to your backend.',
67 'You can also inject tools like file upload or voice input by adding buttons to the prompt footer.',
68];
69
70const pickResponse = (index: number) => RESPONSES[index % RESPONSES.length];
71
72export default function Ai05() {
73 const [messages, setMessages] = useState<DemoMessage[]>(INITIAL_MESSAGES);
74 const [inputValue, setInputValue] = useState('');
75 const [status, setStatus] = useState<ChatStatus>('ready');
76 const replyTimeoutRef = useRef<number | null>(null);
77
78 useEffect(() => {
79 return () => {
80// … truncated

What it pulls in

npm packages

  • @tabler/icons-react
  • ai

Other registry items

  • badge
  • button

Files it writes

  • content/components/ai/ai-05.tsx

Facts

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

Go to the source

blocks.so ephraimduncan/blocks on GitHub Raw registry item This item as JSON

More from blocks

All 76 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AI Chat with Voice Inputai-01blocksBlocksFree1 dep
AI Chat with Model Selectionai-02blocksBlocksFree1 dep
AI Chat Compact Interfaceai-03blocksBlocksFree1 dep
AI Chat with File Attachmentsai-04blocksBlocksFree1 dep
Command Menu with Groupscommand-menu-01blocksBlocksFree1 dep
Command Menu with Keyboard Shortcutscommand-menu-02blocksBlocksFree1 dep
Command Menu with Documentation Searchcommand-menu-03blocksBlocksFree1 dep
Dialog Confirmationdialog-01blocksBlocksFree1 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 on what can be checked

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