Get Started
Components
- Alert
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- ComboBox
- Command
- Data Table
- Date Field
- Date Picker
- Date Range Picker
- Dialog
- Disclosure
- Disclosure Group
- Drawer
- Empty
- Field
- File Trigger
- Grid List
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- ListBox
- Menu
- Number Field
- Pagination
- Popover
- Progress Bar
- Radio Group
- Range Calendar
- Resizable
- Search Field
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag Group
- Text Field
- Textarea
- Time Field
- Toast
- Toggle Button
- Toggle Button Group
- Tooltip
- Tree
- Typography
AI Elements
"use client"
import { useState } from "react"
import {
Suggestion,
Suggestions,
} from "@/components/ai-elements/suggestion"
export function SuggestionDemo() {
const [selected, setSelected] = useState<string | null>(null)
const suggestions = [
"Explain quantum computing",
"Write a haiku",
"Debug my code",
"Plan a trip",
]
return (
<div className="space-y-4">
<Suggestions>
{suggestions.map((suggestion) => (
<Suggestion
key={suggestion}
suggestion={suggestion}
onClick={(value) => setSelected(value)}
/>
))}
</Suggestions>
{selected && (
<p className="text-muted-foreground text-sm">Selected: {selected}</p>
)}
</div>
)
}
Installation
CLI
Manual
pnpmnpmyarnbunpnpm dlx taki-ui@latest add suggestion
Usage
import { Suggestion, Suggestions } from "@/ai-elements/suggestion"<Suggestions>
<Suggestion
suggestion="Explain quantum computing"
onClick={(value) => console.log(value)}
/>
<Suggestion
suggestion="Write a haiku"
onClick={(value) => console.log(value)}
/>
<Suggestion
suggestion="Debug my code"
onClick={(value) => console.log(value)}
/>
</Suggestions>Examples
With Custom Content
<Suggestion suggestion="custom" onClick={handleClick}>
<SparklesIcon className="size-4" />
Custom suggestion
</Suggestion>Different Variants
<Suggestions>
<Suggestion suggestion="Default" variant="outline" />
<Suggestion suggestion="Secondary" variant="secondary" />
</Suggestions>API Reference
Suggestion
| Prop | Type | Default | Description |
|---|---|---|---|
suggestion | string | - | The suggestion text/value |
onClick | (suggestion: string) => void | - | Callback when clicked |
variant | "outline" | "secondary" | "outline" | Visual style variant |
size | "sm" | "default" | "lg" | "sm" | Size variant |
Suggestions
Container component for suggestion chips. Provides horizontal scroll behavior.