BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/agent-elements/input-bar

input-bar

agent-elements/input-bar
FreeComponent

agent-elements publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://agent-elements.21st.dev/r/input-bar.json

Source

registry/agent-elements/components/input-bar.tsxagent-elements.21st.dev/r/input-bar.json · first 6 KB
1"use client";
2
3import { memo, useState, useCallback, useRef, useEffect } from "react";
4import type { ChatStatus } from "ai";
5import { cn } from "./utils/cn";
6
7type InputConfig = {
8 inputBarPlaceholder: string;
9 attachmentButtonPosition: "left" | "right";
10 attachmentPreviewStyle: "thumbnail" | "chip" | "hidden";
11};
12
13const DEFAULT_INPUT_CONFIG: InputConfig = {
14 inputBarPlaceholder: "Send a message...",
15 attachmentButtonPosition: "left",
16 attachmentPreviewStyle: "thumbnail",
17};
18
19import {
20 IconChevronDown,
21 IconChevronUp,
22 IconMessageCircleQuestion,
23 IconX,
24} from "@tabler/icons-react";
25import { SendButton } from "./input/send-button";
26import { AttachmentButton } from "./input/attachment-button";
27import { FileAttachment } from "./input/file-attachment";
28import { useInputTyping } from "./input/input-typing";
29import { QuestionPrompt } from "./question/question-prompt";
30import { Suggestions, type SuggestionItem } from "./input/suggestions";
31import type {
32 QuestionAnswer,
33 QuestionConfig,
34} from "./question/question-prompt";
35
36export type AttachedImage = {
37 id: string;
38 filename: string;
39 url: string;
40 size?: number;
41};
42
43export type AttachedFile = {
44 id: string;
45 filename: string;
46 size?: number;
47};
48
49export type InputBarProps = {
50 onSend: (message: { role: "user"; content: string }) => void;
51 status: ChatStatus;
52 onStop: () => void;
53 placeholder?: string;
54 className?: string;
55
56 // Attachment support
57 onAttach?: () => void;
58 attachedImages?: AttachedImage[];
59 attachedFiles?: AttachedFile[];
60 onRemoveImage?: (id: string) => void;
61 onRemoveFile?: (id: string) => void;
62 onPaste?: (e: React.ClipboardEvent) => void;
63 isDragOver?: boolean;
64 /**
65 * When true (default) clicking a staged image attachment opens a
66 * fullscreen lightbox preview. Set to false to render thumbnails as
67 * plain non-interactive previews.
68 */
69 enableImagePreview?: boolean;
70
71 // Controlled mode
72 value?: string;
73 onChange?: (value: string) => void;
74 disabled?: boolean;
75 autoFocus?: boolean;
76 suggestions?:
77 | SuggestionItem[]
78 | {
79 items: SuggestionItem[];
80 className?: string;
81 itemClassName?: string;
82 };
83
84 // Typing animation
85 typingAnimation?: {
86 text: string;
87 duration: number;
88 image?: string;
89 isActive: boolean;
90 onComplete: () => void;
91 };
92
93 infoBar?: {
94 title?: string;
95 description?: string;
96 onClose?: () => void;
97 position?: "top" | "bottom";
98// … truncated

Facts

Registry
agent-elements
Type
registry:ui
Access
Free
Files written
0
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on agent-elements agent-elements.21st.dev Raw registry item This item as JSON

More from agent-elements

All 25 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
agent-chatagent-chatagent-elementsComponentsFreeno deps
attachment-buttonattachment-buttonagent-elementsComponentsFreeno deps
bash-toolbash-toolagent-elementsComponentsFreeno deps
edit-tooledit-toolagent-elementsComponentsFreeno deps
error-messageerror-messageagent-elementsComponentsFreeno deps
file-attachmentfile-attachmentagent-elementsComponentsFreeno deps
generic-toolgeneric-toolagent-elementsComponentsFreeno deps
markdownmarkdownagent-elementsComponentsFreeno deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex