Agents
Chat Input
The composer for an agent conversation: a growing text field with suggestion chips, removable attachments, a model pill, a mic button and a send button that becomes Stop while the agent streams.
Group: Agents. Exports: ChatInput. Halaska addition with no shadcn/ui equivalent.
Usage
import { ChatInput } from "./halaska-kit";
ChatInput props
valuestring: Controlled text; leave undefined and the field keeps its own stateonChange(text: string) => void: Fires on every edit, and with "" after a sendonSubmit(text: string) => void: Fires with the trimmed text on Enter or the send buttonplaceholderstring(default "Ask Alpha about your inbox…"): Placeholder and accessible name of the field (default: "Ask Alpha about your inbox…")suggestionsstring[](default CHATIN_SUGGESTIONS): Prompt chips above the field; [] hides the row (default: CHATIN_SUGGESTIONS)onSuggestion(text: string) => void: Fires when a chip is picked; without it the chip fills the fieldattachments{ id: string, name: string, kind?: string }[](default []): Files shown as removable chips (default: [])onAttach() => void: Shows the attach button and fires when it is pressedonRemoveAttachment(id: string) => void: Fires from an attachment chip's remove controlmodels{ id: string, label: string }[](default CHATIN_MODELS): Choices in the model pill; [] hides the pill (default: CHATIN_MODELS)modelstring: Controlled model id; leave undefined and the pill keeps its own stateonModelChange(id: string) => void: Fires when a model is pickedstreamingboolean(default false): Turns the send button into Stop (default: false)onStop() => void: Fires when Stop is pressedonVoice() => void: Shows the mic button and fires when it is presseddisabledboolean(default false): Disables the field and every control (default: false)maxRowsnumber(default 6): Rows the field grows to before it scrolls (default: 6)
Accessibility
- The field is a real textarea named by its placeholder; Enter sends and Shift+Enter adds a line.
- Every control is a labelled button: Attach file, Change model, Voice input, Send or Stop, and Remove plus the file name on each attachment.
- The model pill opens a menu of menuitemradio options that take arrow keys, close on Escape and return focus to the pill.
- Suggestions and attachments are exposed as named lists, and the send button is disabled until there is text.
Known gaps
- No slash commands, mentions or inline formatting.
- Attachments are display only: the component fires onAttach and leaves the file picker to the app.
Halaska UI · Components · Patterns · Screens · Install