POLPOUI

ChatSuggestions

Grid of clickable suggestion prompts with optional icons.

Renders a responsive grid of suggestion buttons. Clicking a suggestion calls onSelect with the suggestion text, typically used to send a pre-filled message.

Preview

Import

import {
  ChatSuggestions,
  type ChatSuggestionsProps,
  type ChatSuggestion,
} from "@polpo-ai/chat";

ChatSuggestion

FieldTypeDescription
iconReactNodeOptional icon rendered before the text
textstringSuggestion text, also used as the message on click

Props

PropTypeDefaultDescription
suggestionsChatSuggestion[]requiredList of suggestions to display
onSelect(text: string) => voidrequiredCalled when a suggestion is clicked
columns1 | 2 | 32Number of grid columns
classNamestringAdditional className

Usage

<ChatSuggestions
  suggestions={[
    { icon: <Lightbulb />, text: "Explain quantum computing" },
    { icon: <Code />, text: "Write a Python script" },
    { icon: <BookOpen />, text: "Summarize this article" },
    { icon: <HelpCircle />, text: "How does this work?" },
  ]}
  onSelect={(text) => sendMessage(text)}
  columns={2}
/>

On this page