ZuzJS UI

ZuzJS

UI

v1.0.71

⌃K

Concepts

Overview

Composition

Layout

Accordion

Alert

Auto Complete

Avatar

Badge

Box

Button

Calendar

Chart

ChatBubble

ChatList

Checkbox

ColorScheme

ContextMenu

CookiesConsent

Cover

Cropper

Crumb

DatePicker

Dialog

Drawer

Fab

Filters

Form

Group

Icon

Image

Input

KeyboardKeys

Label

List

NetworkStatus

Overlay

Pagination

Password

PinInput

ProgressBar

Radio

ScrollView

Slider

Search

SelectTabs

Select

Sheet

Slider

Span

Spinner

Switch

Table

TabView

Text

TextArea

TextWheel

Toast

Tooltip

Treeview

On this page

  • Overview
  • Basic Anatomy

ChatBubble

Documentation for ChatBubble component

ChatBubble

1 <ChatBubble text="Hello! How can I help?" side="you" stylePreset="ios" />

Usage

import { ChatBubble, ChatList, BubbleAttachmentType } from "@zuzjs/ui"
<ChatBubble text="Hello! How can I help?" side="you" />

Props

Prop
Type
Required
Description
text
string
—
Message text
side
"me" | "you"
—
Bubble side
stylePreset
"default" | "ios" | "android" | "blocks" | "glass" | "minimal"
—
Bubble UI style
attachments
BubbleAttachment[]
—
File/image/video/link attachment list
arrow
boolean
—
Show/hide message tail arrow
ZuzProps
BoxProps
—
Shared base props

Examples

Basic Usage

<ChatBubble text="Hello! How can I help?" side="you" />

Style Presets

<ChatBubble text="iPhone style" side="me" stylePreset="ios" />
<ChatBubble text="Android style" side="you" stylePreset="android" />
<ChatBubble text="Block style" side="me" stylePreset="blocks" />
<ChatBubble text="Glass style" side="you" stylePreset="glass" />
<ChatBubble text="Minimal style" side="you" stylePreset="minimal" />

Attachments

<ChatBubble
side="me"
text="Please check these files"
attachments={[
{
type: BubbleAttachmentType.File,
name: "Invoice-Apr-2026.pdf",
size: "2.1 MB",
url: "/files/invoice.pdf"
},
{
type: BubbleAttachmentType.Image,
name: "Screenshot.png",
preview: "/images/shot.png",
url: "/images/shot.png"
}
]}
/>

ChatList Date Labels (English/Urdu)

<ChatList
messages={messages}
dateLabels={{
today: "Today",
yesterday: "Yesterday"
}}
/>
<ChatList
messages={messages}
locale="ur-PK"
dateLabels={{
today: "آج",
yesterday: "کل"
}}
/>

ChatList Custom Date Formatter

<ChatList
messages={messages}
formatDateLabel={(ts, { dayDiff, date, labels, locale }) => {
if (dayDiff === 0) return labels.today;
if (dayDiff === 1) return labels.yesterday;
return new Intl.DateTimeFormat(locale || "en-US", {
weekday: "short",
month: "short",
day: "numeric",
year: "numeric"
}).format(date);
}}
/>