laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
34 lines (24 loc) • 711 B
Markdown
# PromptSuggestions
## Overview
Clickable suggestion chips that append a user message via provided callback.
## Props
| Prop | Type | Description |
| --- | --- | --- |
| `label` | `string` | Header text |
| `append` | `(message: { role: "user"; content: string }) => void` | Callback invoked when a suggestion is clicked |
| `suggestions` | `string[]` | List of suggestion texts |
## Example
```tsx
import { PromptSuggestions } from "laif-ds";
export function SuggestionsDemo() {
return (
<PromptSuggestions
label="Try one of these"
suggestions={["What is React?", "Explain TypeScript", "Show me a chart"]}
append={(msg) => console.log("append", msg)}
/>
);
}
```