Skip to content

Chat Composer

@astryxdesign/core v0.7.1 · ChatComposer

Props ​

PropTypeDefaultDescription
v-modelstring—The draft. Bound with v-model, the composer renders exactly that string; left unbound, it keeps the draft itself.
placeholderstringLocalized “Type a message…”Text shown while the draft is empty.
isDisabledbooleanfalseStops editing and sending. A visible stop button stays reachable, so the reader can still cancel a reply.
densityChatComposerDensity'balanced'Spacing inside the body. compact, balanced, or spacious.
elevation'none' | 'low''low'low is raised and deepens on hover and focus. none is flat and draws a border. Keyboard focus in the editor adds the shared focus ring either way; pointer focus does not.
isStopShownbooleanfalseSwaps the send action for stop. Use it while a reply is still streaming in.
statusChatComposerStatus—Feedback object, { type: 'error' | 'warning', message }. The error type is announced as an alert, the warning type as a status.
statusPosition'top' | 'bottom''bottom'Which side of the body the status sits on.

Events ​

EventPayloadDescription
submitstringA trimmed, non-empty draft was submitted. The draft is then cleared.
stop—The stop action was activated.
changestringThe draft changed, including the clear after a successful submit.
update:modelValuestringThe draft the composer is asking for. This is what v-model binds.

Slots ​

SlotDescription
drawerCollapsible content above the body. Usually ChatComposerDrawer.
headerActionsStart side of the header. Small icon buttons line up with the row.
headerContextEnd side of the header. Context such as a usage meter.
inputReplaces the default token input. Read the draft from useChatComposerContext.
footerActionsStart side of the footer. Medium buttons match the send button.
sendActionsSits just before the send button, for example a dictation or microphone button.
sendButtonReplaces the default send and stop button.

Exposed ​

NameTypeDescription
elementHTMLElement | nullThe root frame, for measuring or scrolling.