Interface: MastraChatProps\<TValues\>
Props for MastraChat.
Extends
Section titled “Extends”UseMastraChatOptions<TValues>
Type Parameters
Section titled “Type Parameters”TValues
Section titled “TValues”TValues extends Record<string, unknown> = Record<string, unknown>
Properties
Section titled “Properties”agentId?
Section titled “agentId?”
optionalagentId?:string
Agent to converse with. Defaults to the Mastra plugin’s registered
default agent (clientConfig().defaultAgent).
Inherited from
Section titled “Inherited from”className?
Section titled “className?”
optionalclassName?:string
Extra classes merged onto the chat’s root layout container.
composerActions?
Section titled “composerActions?”
optionalcomposerActions?:ReactNode
Host controls placed beside the model picker in the composer footer.
composerLeadingActions?
Section titled “composerLeadingActions?”
optionalcomposerLeadingActions?:ReactNode
Host controls placed on the left side of the composer footer.
enableClear?
Section titled “enableClear?”
optionalenableClear?:boolean
Show the destructive Clear conversation action. Off by default because thread management already provides new/delete controls and most chats do not need a second way to erase the active conversation.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.enableClear
enableExport?
Section titled “enableExport?”
optionalenableExport?:boolean
Enable chat export. Off by default (opt-in). When on, the header shows an “Export” menu for the whole conversation and each assistant bubble shows a per-message export menu. Both offer PDF (via the browser print dialog) and Markdown; charts and data tables are inlined into the export so it renders reliably offline.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.enableExport
enableFeedback?
Section titled “enableFeedback?”
optionalenableFeedback?:boolean
Surface per-message feedback controls (thumbs up/down + a comment modal) that log to MLflow as trace assessments.
Defaults to auto: controls render when the server reports MLflow
feedback is available. Pass false to hide them or true to request
them explicitly. Regardless of this flag, controls only render when the
server reports MLflow logging is enabled (clientConfig.feedbackEnabled)
and the turn produced a trace id.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.enableFeedback
enableThreads?
Section titled “enableThreads?”
optionalenableThreads?:boolean
Enable built-in conversation (thread) management: the chat tracks a
client-selected thread id, persists it across reloads, lists the
resource’s conversations, and renders a sidebar to switch between
them / start new ones / delete them. On by default. Set false for
the classic single-thread chat anchored to the per-session cookie
(no sidebar, no thread tracking).
Shorthand for threadPlacement: false is "disabled". When both
are passed, enableThreads: false wins.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.enableThreads
modelSelectorActions?
Section titled “modelSelectorActions?”
optionalmodelSelectorActions?:ReactNode
Host controls shown inside the model selector after its endpoint choices.
requestContext?
Section titled “requestContext?”
optionalrequestContext?:MastraRequestContextSource<TValues>
Typed application metadata forwarded through Mastra’s native
requestContext field. A resolver is read when each turn is submitted.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.requestContext
showModelPicker?
Section titled “showModelPicker?”
optionalshowModelPicker?:boolean
Surface the built-in model picker in the header, letting the user
override the serving endpoint per turn (via X-Mastra-Model).
Off by default so the drop-in renders a clean single-model chat;
when false the model catalogue isn’t even fetched.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.showModelPicker
suggestions?
Section titled “suggestions?”
optionalsuggestions?:string[]
Starter questions shown as one-tap buttons on the empty state.
When omitted, the drop-in auto-sources them from the agent’s
Genie space sample questions (via the plugin’s /suggestions
endpoint); when the agent has no Genie space the empty state
stays bare. Pass an explicit list to override that lookup, or
[] to force no suggestions.
Inherited from
Section titled “Inherited from”UseMastraChatOptions.suggestions
threadHistoryLeadingActions?
Section titled “threadHistoryLeadingActions?”
optionalthreadHistoryLeadingActions?:ReactNode
Host controls rendered immediately before the responsive History action.
threadPlacement?
Section titled “threadPlacement?”
optionalthreadPlacement?:ThreadPlacement
Where conversation management renders: "left" / "right" dock the list
to that edge, "top" shows the open conversations as an editor-style tab
strip with a history menu, "disabled" turns thread management off, and
the default "auto" picks "right" while the chat is wide enough for a
side panel and "top" once it gets too narrow for one (measured on the
chat’s own width, so an embedded panel decides on its own space).
Inherited from
Section titled “Inherited from”UseMastraChatOptions.threadPlacement
threadSidebarHeaderActions?
Section titled “threadSidebarHeaderActions?”
optionalthreadSidebarHeaderActions?:ReactNode
Host controls rendered in the full conversation-list header.