# Suggestion

Prompt chips that fill the input when you click one.

Section: Blocks / Chat
Page: https://ui.heyramzi.com/components/suggestion
Import path: `@heyramzi/ui/ai/suggestion`

## Import

```ts
import { Suggestions, Suggestion } from "@heyramzi/ui/ai/suggestion";
import { Input } from "@heyramzi/ui/shadcn/input";
```

## Usage

```svelte
<Suggestions>
  {#each ideas as idea (idea)}
    <Suggestion suggestion={idea} onclick={(text) => (value = text)} />
  {/each}
</Suggestions>
```

## Demo

```svelte
<script lang="ts">
	import { Suggestions, Suggestion } from "@heyramzi/ui/ai/suggestion";
	import { Input } from "@heyramzi/ui/shadcn/input";

	const ideas = [
		"Chase the unpaid invoices",
		"Draft a quote for Acme Freight",
		"Who hasn't replied this week?",
		"Plan Thursday's client call",
	];

	let value = $state("");
</script>

<div class="flex w-full max-w-2xl flex-col gap-3">
	<Suggestions>
		{#each ideas as idea (idea)}
			<Suggestion suggestion={idea} onclick={(s) => (value = s)} />
		{/each}
	</Suggestions>
	<Input bind:value placeholder="Ask anything..." aria-label="Prompt" />
</div>
```

## API

### Suggestions.Suggestion

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `suggestion` | `string` |  | required |
| `onclick` | `(suggestion: string) => void` |  |  |
| `class` | `string` |  |  |
| `children` | `import("svelte").Snippet` |  |  |
| `variant` | `"default"` \| `"outline"` \| `"ghost"` \| `"destructive"` \| `"text"` \| `"dashed"` | `"outline"` |  |
| `size` | `"sm"` \| `"default"` \| `"lg"` | `"sm"` |  |
| `icon` | `boolean` |  |  |
| `ref` | `HTMLButtonElement \| HTMLAnchorElement \| null` |  |  |

Every prop of `HTMLButtonAttributes` from `svelte/elements`, except `children, onclick`.

Every prop of `HTMLAnchorAttributes` from `svelte/elements`, except `children, onclick`.

### Suggestions.Suggestions

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `children` | `Snippet` |  |  |
| `label` | `string` | `"Suggestions"` | The group's name for a screen reader. |
| `class` | `string` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.
