SuggestTextarea
A text area that shows an AI completion as ghost text; Tab accepts it.
- Use it for
- Writing where an AI suggests how the sentence continues.
- Not for
- A chat composer that sends on Enter. Try PromptInput or Textarea.
SuggestTextarea preview
Loading example…
Installation
npm install @stackunseen/uiimport { SuggestTextarea } from '@stackunseen/ui/assistant';@stackunseen/ui/styles.cssUsage and props
Fetch suggestions yourself, for the current text only, and clear them when the text changes or after Escape. The component never calls a model.
Supported inputs
This is the public signature used by this example. Open Code to see how the values and callbacks fit together.
value · onValueChange · suggestion? · onAccept? · onDismiss? · Textarea propsAll props
Loading…
For your coding agent
Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.
- Contract
- value · onValueChange · suggestion? · onAccept? · onDismiss? · Textarea props
- Keeps honest
- Fetch suggestions yourself, for the current text only, and clear them when the text changes or after Escape. The component never calls a model.
- MCP
read_component "SuggestTextarea"on the docs endpoint
Keyboard and customization
Keyboard
Tab accepts and Escape dismisses only while a suggestion shows at the end of the text; otherwise both keep their usual behavior. Screen readers hear the suggestion as a description.
Customization
Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio