# PromptSuggestion

> Chip with a suggested prompt.

Source: https://ui.jcsoftdev.com/docs/components/prompt-suggestion

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

## Import

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

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

## Usage

```tsx
<PromptSuggestion>
  ¿Qué turnos libres hay mañana?
</PromptSuggestion>
```

## Props

| 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).

## Storybook stories

- [Default](/storybook/?path=/story/ai-promptsuggestion--default)
- [List](/storybook/?path=/story/ai-promptsuggestion--list)
- [Narrow](/storybook/?path=/story/ai-promptsuggestion--narrow)
- [Preset Brutal](/storybook/?path=/story/ai-promptsuggestion--preset-brutal)

## Source

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