Suggestion primitives for rendering starter prompts, follow-up actions, and composer suggestions in assistant-ui threads.
For examples and usage patterns, see Suggestion.
API Reference
Title
Renders the title of the suggestion.This primitive renders a <span> element unless asChild is set.
SuggestionPrimitiveTitlePropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement$$typeof?: symbol | string
Description
Renders the description/label of the suggestion.This primitive renders a <span> element unless asChild is set.
SuggestionPrimitiveDescriptionPropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement$$typeof?: symbol | string
Trigger
A button that triggers the suggestion action (send or insert into composer).This primitive renders a <button> element unless asChild is set.
SuggestionPrimitiveTriggerPropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement$$typeof?: symbol | string
send?: booleanWhen true, automatically sends the message. When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`.
clearComposer: boolean= trueWhether to clear the composer after sending. When send is set to false, determines if composer text is replaced with suggestion (true, default), or if it's appended to the composer text (false).