Composer
A ChatGPT-style composer: a 24px-radius surface with a growing text area, attach and voice buttons, and a send circle that activates with text.
Interactive preview · desktop · dark
Installation
Installation is available on the Startup and Business plans. Your personal install command appears here once you have access.
Usage
Import it, pass your props, and make it part of your product.
example.tsx
'use client';
import { TextareaComposer } from '@/components/component-kit/items/textarea-composer';
export function Example() { return ( <TextareaComposer placeholder="Ask anything" onSubmit={(text) => console.log(text)} onAttach={() => console.log('attach')} onVoice={() => console.log('voice')} /> );}Props
| Prop | Type | Default | Description |
|---|---|---|---|
onSubmit | (value: string) => void | — | Called with the trimmed text on Enter or the send button. |
onAttach | () => void | — | Shows the attach button when provided. |
onVoice | () => void | — | Shows the microphone button when provided. |
sending | boolean | false | Disables sending while a request is in flight. |