Components / AI Chat Interfaces

AI Conversation Starter

An empty-state conversation starter with AI branding, welcome message, and suggested topic cards for new chat sessions.

Live Preview — ai-conversation-starter-01

Welcome to ChatGPT

Start a new conversation with AI. Choose a topic below to get started.


Installation

Shadcn UI Setup

Add the necessary Shadcn UI primitives.

npm
npx shadcn-ui@latest add card button badge

Source Code

ai-conversation-starter-01.tsx
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";

interface SuggestedTopic {
    id: number;
    text: string;
    tags?: string[];
}

interface AIConversationStarter01Props {
    onTopicSelect?: (topic: SuggestedTopic) => void;
}

export default function AIConversationStarter01({ onTopicSelect }: AIConversationStarter01Props) {
    // Self-contained suggested topics
    const topics: SuggestedTopic[] = [
        { id: 1, text: "Explain ShadCN UI components", tags: ["UI", "React"] },
        { id: 2, text: "Generate TypeScript helper functions", tags: ["Code", "TS"] },
        { id: 3, text: "Summarize latest AI news", tags: ["AI", "News"] },
        { id: 4, text: "Create a friendly email template", tags: ["Writing", "Email"] },
    ];

    return (
        <Card className="border-0 w-full flex flex-col items-center justify-center p-6 text-center space-y-4">
            {/* AI Branding / Welcome */}
            <div className="space-y-2">
                <h2 className="text-2xl font-bold">Welcome to ChatGPT</h2>
                <p className="text-muted-foreground">
                    Start a new conversation with AI. Choose a topic below to get started.
                </p>
            </div>

            {/* Suggested Topics Grid */}
            <div className="w-[80%] grid grid-cols-1 sm:grid-cols-2 gap-3 mt-4">
                {topics.map((topic) => (
                    <Button
                        key={topic.id}
                        variant="outline"
                        className="flex flex-col items-start p-4 h-auto"
                        onClick={() => onTopicSelect?.(topic)}
                    >
                        <span className="font-medium text-sm">{topic.text}</span>
                        {topic.tags && (
                            <div className="flex flex-wrap gap-1 mt-1">
                                {topic.tags.map((tag) => (
                                    <Badge key={tag} variant="outline" className="text-xs">
                                        {tag}
                                    </Badge>
                                ))}
                            </div>
                        )}
                    </Button>
                ))}
            </div>

            {/* Optional Footer Action */}
            <Button className="mt-4">
                Start a Blank Chat
            </Button>
        </Card>
    );
}

Shadcn Components

Primitives required in your @/components/ui directory.

Component Path
card @/components/ui/card
button @/components/ui/button
badge @/components/ui/badge

Type Reference

Types and interfaces defined in this component.

SuggestedTopic
interface SuggestedTopic {
    id: number;
    text: string;
    tags?: string[];
}
AIConversationStarter01Props
interface AIConversationStarter01Props {
    onTopicSelect?: (topic: SuggestedTopic) => void;
}

Functional Logic

Internal functions used to handle component logic.

Function Parameters
AIConversationStarter01() { onTopicSelect }: AIConversationStarter01Props

JSX Tags Usage

Every JSX/HTML tag used in this component, with usage count and source.

Tag Count Type Source
<Badge> Library @/components/ui/badge
<Card> Library @/components/ui/card
<Button> Native Native HTML
<div> Native Native HTML
<h2> Native Native HTML
<p> Native Native HTML
<span> Native Native HTML

Related Components

  • AI Chat Bubble — A conversational chat bubble component with typing indicator, avatar support, and message timestamps for AI chat interfaces.
  • AI Chat Input Bar — A modern chat input bar with send button, attachment support, and auto-resize textarea for AI conversation interfaces.
  • AI Chat Window — A full-featured AI chat window with message history, streaming response animation, and conversation management.
  • AI Streaming Text — A typewriter-style streaming text component that simulates token-by-token AI response generation with cursor animation.
  • AI Chat Sidebar — A conversation history sidebar listing previous AI chat sessions with search, date grouping, and active state indicators.
  • AI Model Selector — A dropdown model selector for choosing between AI models (GPT-4, Claude, Gemini) with model info badges and capability indicators.