Cameron Kelliher

AI Message Bubble

AI chats 18

About

Chat message bubble with user and assistant roles, provider avatars, timestamps, streaming cursor, and copy-on-hover.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Message Bubble to your project and fits it to your theme.

Code

How AI Message Bubble is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { AiMessageBubble } from "@/components/ui/message-bubble";

export default function Default() {
  return (
    <div className="flex min-h-svh w-full items-center justify-center bg-background p-6 text-foreground">
      <div className="flex w-full max-w-md flex-col gap-6">
        <AiMessageBubble
          role="user"
          content="What's the difference between let and const in JavaScript?"
          timestamp={new Date()}
        />
        <AiMessageBubble
          role="assistant"
          provider="anthropic"
          content={`Both declare block-scoped variables.

- "let" can be reassigned later.
- "const" can't be reassigned after it's set.

Reach for const by default, and use let only when you actually need to reassign.`}
          timestamp={new Date()}
        />
      </div>
    </div>
  );
}

Dependencies

More by Cameron Kelliher

View all
  • AI Chain of Thought

    AI Chain of Thought

    122
  • Helix Loader

    Helix Loader

    104
  • AI Streaming Text

    AI Streaming Text

    55
  • AI Tool Call

    AI Tool Call

    49
  • Glitch Text Loader

    Glitch Text Loader

    46
  • Signal Bars Loader

    Signal Bars Loader

    45
  • AI Prompt Diff

    AI Prompt Diff

    45
  • AI Conversation Tree

    AI Conversation Tree

    39

More in AI chats

View all
  • AI Actions

    AI Actions

    351
  • Agent Chat

    Agent Chat

    21
  • Aquarium Prompt

    Aquarium Prompt

    113
  • System Notice

    System Notice

    2
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    60
  • Color Picker

    Color Picker

    201
  • Chat Bubble

    Chat Bubble

    205
  • Message

    Message

    1