App, assistant composer


Install
npx shadcn add @klarhimmel/app-assistant-composerDetailsAbout, usage, props and more
The box a person writes to an assistant in, drawn by ChatComposer (the one chat input): a rounded pill with + for files, attachments as chips and a round send.
Import
Import
- app/assistant-composer
- About
- The box a person writes to an assistant in, drawn by ChatComposer (the one chat input): a rounded pill with + for files, attachments as chips and a round send.
- Category
- Interface sections for signed-in products. New project? Set it up once: /get-started/installation.
Notes
When to use it
The input box at the bottom of an assistant conversation: a labelled textarea, attachment chips, an attach button and send. Use app-assistant-thread for the messages above it; this block only writes, it does not show replies.
Writing for it
- The label (40 characters) is invisible but names the textarea for screen readers, so write what the box is for, such as the question being asked, not the word Message.
- Pick state to show one situation: filled and over-limit use value (up to 1200 characters) as the draft, while ready always starts empty and shows the placeholder (80).
- At most 3 attachments, each with a name up to 40 characters and a size text of 20. Fill counter and overLimit only for the over-limit state, since they show only there.
Watch out for
Enter sends and Shift+Enter adds a line only when a host wires up onSend. Without it the hint line is hidden and Attach and Stop stay in the tab order but are marked aria-disabled, so the block on its own is a picture of a composer, not a working one.
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | 'Name who the message goes to' | Text, up to 40 characters. |
state | 'ready' | 'filled' | 'sending' | 'disabled' | 'over-limit' | 'filled' | One of 'ready', 'filled', 'sending', 'disabled', 'over-limit'. |
placeholder | string | 'Say what to ask or have done…' | Text, up to 80 characters. |
value | string | 'Write the request in full, in the p…' | Text, up to 1200 characters. |
attachments | { name, size }[] | 2 items | List of up to 3. Each item: name, size. |
attach | string | 'Attach' | Text, up to 20 characters. |
send | string | 'Send' | Text, up to 20 characters. |
stop | string | 'Stop' | Text, up to 20 characters. |
removeLabel | string | 'Remove' | Text, up to 20 characters. |
hint | string | '' | Text, up to 120 characters. |
counter | string | '000 / 000' | Text, up to 20 characters. |
overLimit | string | 'Say by how much it is over and what…' | Text, up to 120 characters. |
notice | string | 'Say why writing is closed and how t…' | Text, up to 120 characters. |