BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Roi UI/ai-chat-tailwind

AI Chat (Tailwind)

roi-ui/ai-chat-tailwind
FreeItem

An AI chat input component with mode selector and action buttons.

Install it

npx shadcn@latest add https://roiui.com/r/ai-chat-tailwind.json

Source

registry/brook/tailwind/blocks/ai-chat/components/ai-chat.tsxroiui.com/r/ai-chat-tailwind.json · first 6 KB
1"use client";
2
3import { ArrowUp, AudioLines, Paperclip } from "lucide-react";
4import { useActionState, useState } from "react";
5import { cn } from "@/lib/utils";
6import { Button } from "@/registry/brook/tailwind/ui/button";
7import { Card, CardContent, CardFooter } from "@/registry/brook/tailwind/ui/card";
8import { Field, FieldControl } from "@/registry/brook/tailwind/ui/field";
9import { Form } from "@/registry/brook/tailwind/ui/form";
10import {
11 Select,
12 SelectIcon,
13 SelectItem,
14 SelectItemIndicator,
15 SelectItemText,
16 SelectList,
17 SelectPopup,
18 SelectPortal,
19 SelectPositioner,
20 SelectSpacer,
21 SelectTrigger,
22 SelectValue,
23} from "@/registry/brook/tailwind/ui/select";
24
25const aiModes = [
26 { value: "creative", label: "Creative" },
27 { value: "fast", label: "Fast" },
28 { value: "reasoning", label: "Reason" },
29 { value: "teach", label: "Teach" },
30];
31
32type FormState =
33 | { status: "idle" }
34 | { status: "success"; data: { message: string; mode: string } }
35 | { status: "error"; error: string; submittedData: { message: string; mode: string } };
36
37const initialFormState: FormState = { status: "idle" };
38
39async function chatAction(_prevState: FormState, formData: FormData): Promise<FormState> {
40 await new Promise((resolve) => setTimeout(resolve, 500));
41
42 const message = formData.get("message") as string;
43 const mode = formData.get("mode") as string;
44
45 return { status: "success", data: { message, mode } };
46}
47
48export function AiChat() {
49 const [formState, submitAction, isPending] = useActionState(chatAction, initialFormState);
50 const [hasContent, setHasContent] = useState(false);
51
52 const defaultMessage = formState.status === "error" ? formState.submittedData.message : "";
53 const defaultMode = formState.status === "error" ? formState.submittedData.mode : aiModes[0].value;
54
55 return (
56 <Form action={submitAction} className="w-full max-sm:flex max-sm:items-center max-sm:justify-center">
57 <Card
58 className={cn(
59 "!gap-3 !p-3 mx-auto h-auto w-full rounded-[var(--radius-lg)] border-[oklch(from_var(--border)_l_c_h_/_0.25)] bg-[var(--mix-card-50-bg)] transition-[border-color] duration-200 ease-in-out focus-within:border-[oklch(from_var(--border)_l_c_h_/_0.5)] hover:border-[oklch(from_var(--border)_l_c_h_/_0.5)]",
60 "min-w-0 max-w-[600px]",
61 "max-sm:min-w-[230px]"
62 )}
63 >
64 <CardContent>
65 <Field
66 className={cn(
67// … truncated

What it pulls in

Other registry items

  • https://roiui.com/r/button-tailwind.json
  • https://roiui.com/r/card-tailwind.json
  • https://roiui.com/r/field-tailwind.json
  • https://roiui.com/r/form-tailwind.json
  • https://roiui.com/r/select-tailwind.json

Files it writes

  • registry/brook/tailwind/blocks/ai-chat/components/ai-chat.tsx

Facts

Registry
Roi UI
Type
registry:item
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

roiui.com preetecool/roi-ui on GitHub Raw registry item This item as JSON

More from Roi UI

All 123 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionRoi UIOtherFreeno deps · 2 files
Accordion (Tailwind)accordion-tailwindRoi UIOtherFreeno deps
AI Chatai-chatRoi UIOtherFreeno deps · 2 files
AlertalertRoi UIOtherFree1 dep · 2 files
Alert Dialogalert-dialogRoi UIOtherFreeno deps · 2 files
Alert Dialog (Tailwind)alert-dialog-tailwindRoi UIOtherFreeno deps
Alert (Tailwind)alert-tailwindRoi UIOtherFree1 dep
AutocompleteautocompleteRoi UIOtherFreeno deps · 2 files

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