Logo
  • Documentation
  • Components
  • New Component Request
GitHub
GitHub
    Treon Studio
    Discord
    Twitter

    Welcome

    Introduction
    Components
    Contributors
    Installation
    Roadmap
    Status - Beta

    Components

    Author TooltipCalendar Event CardCode BlockComponent Preview TooltipChat ComposerEmail Compose CardFile DropzoneFile PreviewGitHub Stars ButtonGoal CardHolo CardKnowledge GraphLink PreviewiOS Message BubblesModel SelectorNavbar MenuNested MenuNotification CardPricing CardRaised ButtonSearch Results TabsSlash Command DropdownTodo ItemTwitter CardWeather CardWorkflow Card

    Form Inputs

    Async Select
    Button
    Button Group
    Checkbox
    Color Picker
    Combobox
    Hierarchical Select
    Input
    Input Base
    Input O T P
    Mask Input
    Multi Select
    Number Input
    Radio Card Group
    Radio Group
    Range Slider
    Search Input
    Segmented Button
    Select
    Slider
    Switch
    Tag Input
    Textarea
    Voice Input

    Layout

    Aspect Ratio
    Card
    Card Icons
    Card Input
    Collapsible
    Divider
    Grid
    Island
    Panel
    Portal
    Resizable
    Scroll Area
    Scroll Shadow
    Separator
    Spacer
    Visually Hidden
    Visually Hidden Input

    Navigation

    Breadcrumb
    Context Menu
    Dropdown Menu
    Menu
    Navbar
    Pagination
    Sidebar
    Steps
    Tab Navigation
    Tabs

    Feedback

    Alert
    Banner
    Callout
    Circular Progress
    Empty State
    Error Message
    Error Page
    Loader Inline
    Loader Screen
    Progress
    Progress Bar
    Skeleton
    Spinner
    Status Dot
    Toast
    Toaster
    Tooltip
    Top Banner
    Tour

    Data Display

    Advanced Table
    Badge
    Badge Overflow
    Data Table
    Description List
    Listbox
    Table
    Tag
    Timeline
    Tree
    Virtualized

    Overlays

    Alert Dialog
    Dialog
    Dialog Stack
    Drawer
    Hover Card
    Popover

    Charts

    Area Chart
    Bar Chart
    Bar List
    Category Bar
    Combo Chart
    Comparison
    Conditional Bar Chart
    Contribution Graph
    Radar Chart

    Calendars

    Attendance Calendar
    Calendar
    Date Picker
    Date Time Field
    Full Calendar
    Gantt
    Mini Calendar
    Schedule
    Schedule Grid
    Time Field

    Typography

    Code
    Code Block
    Control Help
    Control Label
    Field
    Heading
    Kbd
    Label
    Link
    Markdown
    Rich Text Editor
    Snippet
    Text

    Media

    Avatar
    Avatar Group
    Deck
    Document Preview
    File List
    File Upload
    Glimpse
    Image
    Image Crop
    Image Zoom
    Photo Gallery
    Profile Picture
    Q R Code
    Q R Scanner

    User

    Discussion
    Rating
    Testimonial
    User
    User Card

    Interactive

    Accordion
    Action Bar
    Command
    Copy Button
    Cursor
    Emoji Picker
    Fade
    Inline Edit
    Kanban
    Marquee
    Orbit
    Ripple
    Sortable

    Specialized

    App Header
    Bulk Grade Input
    Credit Card
    Footer
    Level Picker
    Notification Card
    Password Strength
    Payment Method
    Pricing Table
    Sandbox
    Stat Card
    Ticker
    Usage Card
    Wizard
    DocsComponents

    iOS Message Bubbles

    Beautiful iOS-style message bubbles with authentic iMessage appearance, message grouping, and tail effects.

    Made with ❤️ byTreon Studio.Source code available onGitHub

    On This Page

    • Usage in Gaia
    • Simple Bubbles
    • Grouped Messages
    • Grouped with All Rounded Corners
    • Installation
    • Usage
    • Single Message Bubble
    • Chat Message
    • Components
    • MessageBubble
    • ChatMessage
    • Features
    • Examples
    • Custom Content in Bubble
    • Manual Grouping
    • Long Messages
    • Styling
    • Customizing Grouped Message Corners
    • Use Cases
    • Notes
    Website screenshot
    Meet Bungas
    Your open-source, proactive personal AI assistant with 200+ integrations. Bungas combines todos, goals, calendar, and email into one system, turns tasks into automated workflows, and completes work instead of just tracking it. Open-source and self-hostable with support for custom automations and multi-step workflows.

    Hey! How are you doing?

    10:30 AM

    I'm doing great! Just working on some new features.

    10:31 AM

    That sounds exciting!

    What are you building?

    I'd love to hear more about it.

    10:32 AM

    I'm building a new UI component library!

    It has beautiful iOS-style message bubbles just like these 😊

    10:33 AM

    Usage in Gaia

    The core chat unit. iOS-style aesthetics with smart grouping.

    Simple Bubbles

    Hey there! How's it going?

    This is a single message bubble on the left side

    I'm doing great, thanks for asking!

    This is a single message bubble on the right side

    Grouped Messages

    Hey! I have a few things to tell you

    First, the project looks amazing

    Second, I love the design

    And finally, great work! 🎉

    Thanks so much!

    I really appreciate the feedback

    It means a lot to me 😊

    Grouped with All Rounded Corners

    Hey! I have a few things to tell you

    First, the project looks amazing

    Second, I love the design

    And finally, great work! 🎉

    Thanks so much!

    I really appreciate the feedback

    It means a lot to me 😊

    Installation

    npx shadcn@latest add https://bungas.treonstudio.com/r/message-bubble.json

    Usage

    Single Message Bubble

    import { MessageBubble } from "@/components/ui/message-bubble";
     
    export default function Example() {
      return (
        <>
          <MessageBubble message="Hey there!" variant="received" />
          <MessageBubble message="Hi! How are you?" variant="sent" />
        </>
      );
    }

    Chat Message

    import { ChatMessage } from "@/components/ui/message-bubble";
     
    export default function Example() {
      return (
        <ChatMessage
          variant="received"
          messages={["Hey!", "How are you doing?", "Long time no see!"]}
          timestamp="10:30 AM"
        />
      );
    }

    Components

    MessageBubble

    The core message bubble component with iOS-style tails.

    Props

    PropTypeDefaultDescription
    messagestring-The message text to display
    variant"sent" | "received""received"Message alignment and styling
    grouped"first" | "middle" | "last" | "none""none"Position in grouped messages
    classNamestringundefinedAdditional CSS classes
    childrenReactNodeundefinedCustom content (overrides message)

    ChatMessage

    A complete message with optional timestamp. Automatically groups multiple messages.

    Props

    PropTypeDefaultDescription
    messagesstring[]-Array of message texts
    variant"sent" | "received""received"Message alignment and styling
    timestampstringundefinedMessage timestamp
    showTimestampbooleantrueWhether to show timestamp
    classNamestringundefinedAdditional CSS classes

    Features

    • iOS-Style Design: Authentic iMessage-like appearance with tails
    • Message Grouping: Automatically groups consecutive messages
    • Sent Message Color: Uses #00bbff (iOS blue) for sent messages
    • Timestamps: Optional timestamps for messages
    • Theme Support: Works with light and dark modes
    • Responsive: Adapts to different screen sizes
    • Customizable: Extensive prop options for customization
    • Accessible: Proper semantic HTML structure

    Examples

    Custom Content in Bubble

    <MessageBubble variant="received">
      <div className="flex items-center gap-2">
        <img src="/emoji.png" className="size-6" />
        <span>Custom content with emoji!</span>
      </div>
    </MessageBubble>

    Manual Grouping

    <MessageBubble message="First message" variant="sent" grouped="first" />
    <MessageBubble message="Middle message" variant="sent" grouped="middle" />
    <MessageBubble message="Last message" variant="sent" grouped="last" />

    Long Messages

    <MessageBubble
      message="This is a really long message that will automatically wrap to multiple lines while maintaining the iOS-style bubble appearance with proper padding and borders."
      variant="received"
    />

    Styling

    The component uses specific colors for authentic iOS appearance:

    • Sent messages: #00bbff (iOS blue) with black text
    • Received messages: #27272a (dark gray) with white text
    • Tails: Pseudo-elements create the iconic message tail effect

    Customizing Grouped Message Corners

    The default CSS uses variant-specific corner radii. You can customize the grouping style:

    Tight Corners (Single Side):

    .imessage-grouped-first {
      border-radius: 20px 20px 20px 5px !important;
    }
     
    .imessage-grouped-last {
      border-radius: 5px 20px 20px 20px !important;
    }
     
    .imessage-grouped-middle {
      border-radius: 5px 20px 20px 5px !important;
    }

    All Rounded Corners:

    .imessage-grouped-first {
      border-radius: 20px 20px 20px 20px !important;
    }
     
    .imessage-grouped-last {
      border-radius: 20px 20px 20px 20px !important;
    }
     
    .imessage-grouped-middle {
      border-radius: 20px 20px 20px 20px !important;
    }

    You can wrap groups in a div with a custom class to apply specific corner styles per group.

    Use Cases

    • Chat Applications: Build messaging interfaces like WhatsApp, iMessage, or Telegram
    • Customer Support: Create support chat widgets
    • AI Chatbots: Display conversational AI responses
    • Comments Sections: Show threaded discussions
    • Notifications: Display message-style notifications
    • Onboarding: Create conversation-style tutorials

    Notes

    • Message bubbles automatically add tails only on the last message of a group
    • The grouped prop allows manual control over tail visibility
    • Avatars are only shown for received messages by default
    • Timestamps can be customized with any string format
    • The component is fully responsive and works on mobile devices