Getting Started
Components
- Advanced Toast
- ArrowButton
- Arrows
- Avatar
- Backdrop
- Basic Toast
- Breadcrumb
- Button
- CardBackground
- Card
- Carousel
- ChatButton
- ChatInput
- ChatMessage
- ChatTypingIndicator
- ChatWindow
- CheckboxSelect
- Checkbox
- Checkboxes
- Chip
- ChoiceExpander
- Clickable
- Date Field
- Dropdown
- ElasticHeight
- ExpandableCard
- Filter
- Form Control
- Form Label
- Frame
- HamburgerIcon
- Heading
- Image
- Link
- Loader
- Number Field
- Pagination
- Password
- Phone Field
- Popin
- Portal
- Prose
- Radio Group
- Radio
- Range
- Scrollbar
- Select
- SidebarLayout
- SliderFrame
- Spinner
- Switch
- Tabs
- Tag
- TextField
- Tooltip
- ValidationMessage
'use client';
import { useState } from 'react';
import { ChatInput } from '@/ui/ChatInput';
export function ChatInputDemo() {
const [value, setValue] = useState('');
return (
<div className="w-[380px]">
<ChatInput
value={value}
onValueChange={setValue}
onSubmit={() => setValue('')}
onAudioClick={() => {}}
/>
</div>
);
}
Installation
npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/chat-input.json
Usage
import { ChatInput } from '@/ui/ChatInput';
import { useState } from 'react';
export function Component() {
const [value, setValue] = useState('');
return (
<ChatInput
value={value}
onValueChange={setValue}
onSubmit={() => {
console.log('Submitted:', value);
setValue('');
}}
onAudioClick={() => console.log('Audio clicked')}
/>
);
}API Reference
ChatInput
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Required. Controlled input value |
onValueChange | (value: string) => void | — | Required. Called on every keystroke |
onSubmit | () => void | — | Required. Called when the form is submitted |
placeholder | string | "Ask a question?" | Input placeholder text (also used as aria-label) |
onAudioClick | () => void | undefined | When provided, renders an audio/attachment button |
className | string | undefined | Additional CSS classes on the <form> element |
Inherits all HTMLFormElement attributes.
Notes
- The send button is disabled when the input is empty or whitespace only.
- The audio button only renders when
onAudioClickis provided. - The component is fully controlled — manage state externally.
- Used as the bottom bar inside
ChatWindow.