Skip to content

Chat Composer Input

@astryxdesign/core v0.7.1 · ChatComposerInput

Usage ​

Pass ChatComposerInput to ChatComposer's input slot when the draft needs trigger menus, inline tokens, history recall, dictation insertion, or file intake.

ts
import { ChatComposerInput } from '@astryx-vue/core/Chat'

Anatomy

ElementDescription
Input rootThe themed container that forwards the root ref and BaseProps styling seams.
Editable surfaceThe labeled contenteditable textbox or combobox that owns text, selection, keyboard, paste, and drop behavior.
PlaceholderVisual guidance shown only while the serialized draft is empty.
Trigger menuThe suggestion popup rendered while a configured trigger is active.
Inline tokenA non-editable badge or custom rendering with a stable serialized value.

Best practices ​

GuidancePractices
DoUse the exposed handle for programmatic text or token insertion; inserted text follows the same change pipeline as typing.
DoUse files for files pasted or dropped onto the editor, and keep file validation and upload progress in the product layer.
Don'tUse custom token rendering for ordinary mentions or commands; prefer the structured badge form so tokens remain predictable and themeable.

Examples ​

Common configurations, variations, and states.

ChatComposerInput — Controlled

Value: ""

Controlled chat input with live value display. Use controlled mode when you need to read or transform the input value outside the composer.

ChatComposerInput — Disabled

Composer in a disabled state. Use when the input should be visible but not interactive, such as during streaming or when a prerequisite is unmet.

ChatComposerInput — Mentions

Value: ""

Chat input with an @ trigger that opens a typeahead menu for mentioning users. Selected names appear as inline tokens.

ChatComposerInput — Multiple Triggers

Type @ for mentions (blue) or / for commands (yellow)
Value: ""

Chat input with both @ mentions and / commands. Each trigger type renders tokens in a distinct color so users can tell them apart at a glance.

ChatComposerInput — Slash Commands

Chat input with a / trigger for command selection. Use for AI assistants or bots that support structured commands.