GitHubX

Chat Suggestions

PreviousNext

A composable component for displaying chat prompt suggestions as clickable buttons.

Installation

pnpm dlx shadcn@latest add @simple-ai/chat-suggestions

About

The Chat Suggestions component provides a composable way to display prompt suggestions to users in your chat interface. Following the shadcn/ui design philosophy, it's built with small, reusable pieces that can be composed together to create flexible layouts.

Perfect for onboarding new users, suggesting common queries, or providing quick actions in empty chat states.

Usage

import {
  ChatSuggestion,
  ChatSuggestions,
  ChatSuggestionsContent,
  ChatSuggestionsDescription,
  ChatSuggestionsHeader,
  ChatSuggestionsTitle,
} from "@/components/ui/chat-suggestions"

Basic Usage

<ChatSuggestions>
  <ChatSuggestionsTitle>Try these prompts:</ChatSuggestionsTitle>
  <ChatSuggestionsContent>
    <ChatSuggestion onClick={() => console.log("What can you help me with?")}>
      What can you help me with?
    </ChatSuggestion>
    <ChatSuggestion onClick={() => console.log("Show me examples")}>
      Show me examples
    </ChatSuggestion>
  </ChatSuggestionsContent>
</ChatSuggestions>

With Header and Description

<ChatSuggestions>
  <ChatSuggestionsHeader>
    <ChatSuggestionsTitle>Quick start</ChatSuggestionsTitle>
    <ChatSuggestionsDescription>
      Click a suggestion to get started
    </ChatSuggestionsDescription>
  </ChatSuggestionsHeader>
  <ChatSuggestionsContent>
    <ChatSuggestion>Tell me about your features</ChatSuggestion>
    <ChatSuggestion>How do I get started?</ChatSuggestion>
  </ChatSuggestionsContent>
</ChatSuggestions>

Examples

Simple Suggestions

A minimal chat suggestions layout with just a title and suggestions.