Prompt Suggestion

A component for implementing interactive prompt suggestions in AI interfaces, with both clickable suggestion buttons and highlight mode for matched text.

Installation

pnpm dlx shadcn-svelte@latest add http://sveltekit-prerender/r/prompt-suggestion.json

Examples

Demo

Props

PromptSuggestion

PropTypeDefaultDescription
childrenSnippet-Button label or custom content rendered inside the suggestion.
variantButtonVariant-Button style variant when rendered as a suggestion.
sizeButtonSize-Button size used for the suggestion.
classstring-Additional CSS classes for the button.
highlightstring-When set, highlights the matching substring in the content.
refHTMLElement | null-Bindable reference to the rendered button element.
onclick(event: MouseEvent) => void-Called when the suggestion is clicked.
disabledboolean-Disables the button.
type"button" | "submit" | "reset""button"Native button type.