Skip to content

PromptSuggestion

Open .md
Live preview

Loading example…

Chip with a suggested prompt. Pressing it hands the text to onSelect.

import { PromptSuggestion } from "@jcsoftdev/ui/ai";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/ai/prompt-suggestion.

<PromptSuggestion>
¿Qué turnos libres hay mañana?
</PromptSuggestion>
Prop Type Default Description
onSelect ((text: string) => void) Receives the suggestion text when pressed (the visible label is the text).
children * string

* marks a required prop.

It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).

packages/ui/src/ai/prompt-suggestion/prompt-suggestion.tsx