Chat & Messaging
⋯
Message renders Figma’s Message set from public parts: avatar, author and time, a bordered
bubble, delivery status, reactions, and the inverse action panel. MessageComposer renders the
Minimal and Medium types of Figma’s Message action set.
import { Message } from "@nesra/ui/message";
export function ReceivedMessage() { return ( <Message> <Message.Avatar name="Phoenix Baker" src="/avatars/phoenix.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.Text>Hey Olivia, can you please review the latest design?</Message.Text> </Message.Bubble> </Message.Content> </Message> );}Message and MessageComposer are also exported from @nesra/ui.
import { Message } from "@nesra/ui/message";
export function MessageBasicExample() { return ( <Message.List aria-label="Conversation with Phoenix Baker" className="w-full max-w-[480px]"> <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.Text>Hey Olivia, can you please review the latest design?</Message.Text> </Message.Bubble> </Message.Content> </Message> <Message sent> <Message.Content> <Message.Header> <Message.Author>You</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> <Message.Status label="Read 2:20 PM" status="read" /> </Message.Header> <Message.Bubble> <Message.Text>Sure thing, I’ll have a look today.</Message.Text> </Message.Bubble> </Message.Content> </Message> </Message.List> );}Composition
Section titled “Composition”Message.List ol└── Message article in an li ├── Message.Avatar └── Message.Content ├── Message.Header │ ├── Message.Author │ ├── Message.Time │ └── Message.Status ├── Message.Bubble │ ├── Message.Reply │ ├── Message.Text │ ├── Message.File │ ├── Message.Audio │ ├── Message.LinkPreview │ └── Message.LinkMinimal ├── Message.Image ├── Message.Video ├── Message.Typing ├── Message.Reactions │ └── Message.Reaction └── Message.Actions └── Message.Action
MessageComposer form├── MessageComposer.Input└── MessageComposer.Actions ├── MessageComposer.Tool └── MessageComposer.SendEvery part is optional. Figma’s received messages show Message.Avatar. Sent messages omit it and
show Message.Status after the time. Image, video, and typing content sit outside a bubble.
Examples
Section titled “Examples”Sent and received
Section titled “Sent and received”sent aligns the message to the end of Message.List. The bubble’s square corner points toward
the sender: top left for received messages and top right for sent messages.
Message.Reply renders the quoted message as a blockquote above the reply text. It truncates to
one line.
import { Message } from "@nesra/ui/message";
export function MessageReplyExample() { return ( <Message sent> <Message.Content> <Message.Header> <Message.Author>You</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> <Message.Status status="unread" /> </Message.Header> <Message.Bubble> <Message.Reply>Hey Olivia, can you please review the latest design?</Message.Reply> <Message.Text>Sure thing, I’ll have a look today.</Message.Text> </Message.Bubble> </Message.Content> </Message> );}Status
Section titled “Status”status is unread, read, or failed. label names the icon and is the tooltip text. Hover or
focus an icon to see its tooltip.
import { Message } from "@nesra/ui/message";
export function MessageStatusExample() { return ( <div className="flex items-center gap-nesra-spacing-2xl"> <Message.Status status="unread" /> <Message.Status label="Read 2:20 PM" status="read" /> <Message.Status label="Failed to send" status="failed" /> </div> );}Action panel
Section titled “Action panel”Message.Actions appears while the message is hovered or contains focus. open keeps it visible,
as in Figma’s Actions panel=True variants. Each Message.Action requires label and shows it as a
tooltip. The application owns what each action does.
import { Message } from "@nesra/ui/message";import { Copy, Pencil, RefreshCcw, Sparkles } from "lucide-react";
export function MessageActionsExample() { return ( <Message className="pb-nesra-spacing-xl"> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.Text>Hover this message, or press Tab to reach its actions.</Message.Text> </Message.Bubble> <Message.Actions> <Message.Action label="Ask AI"> <Sparkles /> </Message.Action> <Message.Action label="Edit"> <Pencil /> </Message.Action> <Message.Action label="Regenerate"> <RefreshCcw /> </Message.Action> <Message.Action label="Copy" onClick={() => navigator.clipboard?.writeText("Hover this message")} > <Copy /> </Message.Action> </Message.Actions> </Message.Content> </Message> );}Reactions
Section titled “Reactions”Message.Reaction is a toggle. Use pressed and onPressedChange to control it, or
defaultPressed to leave it uncontrolled. The application owns the reaction data and count.
import { Message } from "@nesra/ui/message";import { useState } from "react";
export function MessageReactionsExample() { const [liked, setLiked] = useState(false);
return ( <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.Text>Shipped the new onboarding flow.</Message.Text> </Message.Bubble> <Message.Reactions> <Message.Reaction emoji="❤️" label="Heart" /> <Message.Reaction count={liked ? 3 : 2} emoji="👌" label="OK hand" onPressedChange={setLiked} pressed={liked} /> </Message.Reactions> </Message.Content> </Message> );}Message.File uses the same fileType icons as File Upload Card. Wrap it in a link or add an
action when the file can be downloaded.
import { Message } from "@nesra/ui/message";
export function MessageFileExample() { return ( <Message sent> <Message.Content> <Message.Header> <Message.Author>You</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.File fileName="Tech design requirements.pdf" fileSize="200 KB" /> </Message.Bubble> </Message.Content> </Message> );}Message.Image renders a 4:3 image with an optional file name and size caption. alt is required.
import { Message } from "@nesra/ui/message";
export function MessageImageExample() { return ( <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Image alt="Blurred pastel gradient with an orange and blue streak" fileName="Background image.jpg" fileSize="128 KB" src="/message/background-image.jpg" /> </Message.Content> </Message> );}Message.Video renders a native video with Figma’s .Video Player overlay: a center play button
for pointers and a control bar with Play or Pause, Mute or Unmute, and Full screen. The example has
a poster only. Set src to play a file.
import { Message } from "@nesra/ui/message";
export function MessageVideoExample() { return ( <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> {/* Set src to your video file. */} <Message.Video label="Product walkthrough" poster="/message/video-poster.jpg" preload="none" /> </Message.Content> </Message> );}Message.Audio renders a native audio with a play button, a decorative waveform, and the
duration text. Bars before the playback position darken while it plays. Pass waveform heights
from 0 to 1 to draw the recording’s shape.
import { Message } from "@nesra/ui/message";
export function MessageAudioExample() { return ( <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> {/* Set src to your recording. */} <Message.Audio duration="00:28" label="voice note from Phoenix Baker" preload="none" /> </Message.Bubble> </Message.Content> </Message> );}Link preview and Link minimal
Section titled “Link preview and Link minimal”Message.LinkPreview shows an Open Graph image above the link. Message.LinkMinimal shows a
title and description card above the link. The link text defaults to href.
import { Message } from "@nesra/ui/message";
export function MessageLinksExample() { return ( <Message.List aria-label="Shared links" className="w-full max-w-[480px]"> <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> <Message.Time dateTime="2026-11-06T14:20">Friday 2:20pm</Message.Time> </Message.Header> <Message.Bubble> <Message.LinkPreview href="https://www.nesra.ai" image="/message/open-graph.jpg" /> </Message.Bubble> </Message.Content> </Message> <Message sent> <Message.Content> <Message.Header> <Message.Author>You</Message.Author> <Message.Time dateTime="2026-11-06T14:21">Friday 2:21pm</Message.Time> </Message.Header> <Message.Bubble> <Message.LinkMinimal description="Nesra enables companies in Indonesia to remove repetitive work, see the business clearly through data, and apply practical AI." href="https://www.nesra.ai" title="Nesra AI - Future of winning enterprise workflow and organization with AI and automation" /> </Message.Bubble> </Message.Content> </Message> </Message.List> );}Writing
Section titled “Writing”Message.Typing renders Figma’s Writing state. The dots bounce only when the user has not asked
for reduced motion.
import { Message } from "@nesra/ui/message";
export function MessageTypingExample() { return ( <Message> <Message.Avatar name="Phoenix Baker" src="/message/phoenix-baker.png" /> <Message.Content> <Message.Header> <Message.Author>Phoenix Baker</Message.Author> </Message.Header> <Message.Typing label="Phoenix Baker is typing" /> </Message.Content> </Message> );}Composer: Minimal
Section titled “Composer: Minimal”MessageComposer defaults to variant="minimal": a one-line field beside an icon send button.
Enter submits the form and Shift+Enter inserts a new line. Set submitOnEnter={false} on the input
to turn this off.
import { MessageComposer } from "@nesra/ui/message";import { useState, type FormEvent } from "react";
export function MessageComposerMinimalExample() { const [value, setValue] = useState(""); const [sent, setSent] = useState<string[]>([]);
const handleSubmit = (event: FormEvent<HTMLFormElement>) => { event.preventDefault(); if (!value.trim()) return; setSent((messages) => [...messages, value.trim()]); setValue(""); };
return ( <div className="flex w-full max-w-[360px] flex-col gap-nesra-spacing-md"> <MessageComposer onSubmit={handleSubmit}> <MessageComposer.Input onChange={(event) => setValue(event.target.value)} placeholder="Message" value={value} /> <MessageComposer.Send /> </MessageComposer> <p aria-live="polite" className="type-nesra-body-xsmall-regular text-nesra-text-support"> {sent.length ? `Sent: ${sent.at(-1)}` : "Press Enter to send. Shift+Enter adds a line."} </p> </div> );}Composer: Medium
Section titled “Composer: Medium”variant="medium" renders a 128px text area. MessageComposer.Actions places the tools and a text
Send button at its bottom right.
import { MessageComposer } from "@nesra/ui/message";import { Paperclip, Smile } from "lucide-react";
export function MessageComposerMediumExample() { return ( <MessageComposer className="max-w-[360px]" onSubmit={(event) => event.preventDefault()} variant="medium" > <MessageComposer.Input placeholder="Message" /> <MessageComposer.Actions> <MessageComposer.Tool label="Attach file"> <Paperclip /> </MessageComposer.Tool> <MessageComposer.Tool label="Add emoji"> <Smile /> </MessageComposer.Tool> <MessageComposer.Send /> </MessageComposer.Actions> </MessageComposer> );}Figma’s Message action set is still changing. The Advanced type, with its agent picker,
Shortcuts, and Attach labels, and the top-right voice button are not implemented yet.
Light and Dark
Section titled “Light and Dark”Chat parts follow the page theme. Dark applies when an ancestor has the dark class or
data-theme="dark".
- Bubbles, reply quotes, link cards, reactions, and the typing indicator use
Foundation/bg-neutralwith aStroke/stroke-borderborder. Text usesText/text-body. - The reply quote has a 3px
Stroke/stroke-brand-primaryleft edge. - The action panel uses
Foundation/bg-inversewithIcon/icon-inversebuttons. Tooltips use the inverse roles. - Status icons use
Icon/icon-muted, andIcon/icon-neutralon hover or focus. Failed usesIcon/icon-destructive. - The audio play button uses
Foundation/bg-brand-primarywithIcon/icon-on-brand. - Video overlay buttons use
Alpha/black-50withBackdrop blur/backdrop-blur-mdandIcon/icon-staticWhite, so they stay the same in both modes. - Links use
Text/text-link.
Accessibility
Section titled “Accessibility”Message.Listis anol. EachMessageis anarticleinside anli, so assistive technology reads messages in order and reports their count.Message.Avataris hidden from assistive technology becauseMessage.Authornames the sender.Message.Statusis a focusable image named bylabel. Focus or hover shows the same text as a tooltip.Message.Actionsis atoolbarnamedMessage actions. It is one tab stop. Arrow keys move between actions. Focusing an action reveals a hidden panel, so keyboard users reach the same actions as pointer users.Message.Reactionis a toggle button witharia-pressed. Its name islabelfollowed bycount. The emoji is hidden from assistive technology.Message.Typingis astatusregion. Give it alabelsuch asPhoenix Baker is typing.Message.VideoandMessage.Audiorequirelabel. Their controls are native buttons. Provide captions or a transcript for recorded speech.MessageComposer.Inputis namedMessageunless you setaria-labeloraria-labelledby. EachMessageComposer.Toolrequireslabel.- The application owns live announcements of new messages, unread counts, scrolling, and loading older history.
API reference
Section titled “API reference”Message
Section titled “Message”| Prop | Type | Default | Description |
|---|---|---|---|
sent |
boolean |
false |
Aligns to the end and squares the bubble’s top-right corner. |
className |
string |
— | Adds or overrides classes. The default maximum width is 360px. |
Other native article props are forwarded. A ref points to the article.
Message.List
Section titled “Message.List”Native ol props are forwarded. A ref points to the list. Give it an aria-label.
Message.Avatar
Section titled “Message.Avatar”Accepts name, src, initials, disabled, and className from Avatar.
The size is fixed at 32px.
Message.Content, Message.Header, and Message.Bubble
Section titled “Message.Content, Message.Header, and Message.Bubble”Native div props are forwarded.
Message.Author
Section titled “Message.Author”Native span props are forwarded. Long names truncate.
Message.Time
Section titled “Message.Time”Native time props are forwarded. Set dateTime to a machine-readable value.
Message.Status
Section titled “Message.Status”| Prop | Type | Default | Description |
|---|---|---|---|
status |
"unread" | "read" | "failed" |
required | Icon shown. |
label |
string |
Unread, Read, or Failed |
Accessible name and tooltip text. |
Other native span props are forwarded.
Message.Text
Section titled “Message.Text”Native p props are forwarded. Line breaks in the text are preserved.
Message.Reply
Section titled “Message.Reply”Native blockquote props are forwarded.
Message.Actions
Section titled “Message.Actions”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
Message actions |
Accessible toolbar name. |
open |
boolean |
false |
Keeps the panel visible. |
Other Base UI Toolbar Root props are forwarded.
Message.Action
Section titled “Message.Action”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
required | Accessible name and tooltip text. |
children |
ReactNode |
required | A 16px icon. |
Other Base UI Toolbar Button props, including onClick and disabled, are forwarded.
Message.Reactions
Section titled “Message.Reactions”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
Reactions |
Accessible group name. |
Other native div props are forwarded.
Message.Reaction
Section titled “Message.Reaction”| Prop | Type | Default | Description |
|---|---|---|---|
emoji |
ReactNode |
required | Emoji character or 16px image. |
label |
string |
required | Accessible name, such as Heart. |
count |
number |
— | Visible count. Omit to show the emoji only. |
pressed |
boolean |
— | Controlled pressed state. |
defaultPressed |
boolean |
false |
Initial uncontrolled pressed state. |
onPressedChange |
(pressed, details) => void |
— | Called when the toggle changes. |
Other Base UI Toggle props are forwarded.
Message.File
Section titled “Message.File”| Prop | Type | Default | Description |
|---|---|---|---|
fileName |
string |
required | Visible file name. |
fileSize |
string |
required | Formatted size, 200 KB. |
fileType |
"pdf" | "doc" | "xls" | "img" |
"pdf" |
File type icon. |
Other native div props are forwarded.
Message.Image
Section titled “Message.Image”| Prop | Type | Default | Description |
|---|---|---|---|
src |
string |
required | Image URL. |
alt |
string |
required | Text alternative. |
fileName |
string |
— | Caption file name. |
fileSize |
string |
— | Caption file size after the name. |
Other native figure props are forwarded.
Message.Video
Section titled “Message.Video”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
required | Accessible name of the video. |
className applies to the player frame. Other native video props, such as src, poster, and
preload, are forwarded. controls is not accepted because the overlay provides the controls. Pass caption
track elements as children.
Message.Audio
Section titled “Message.Audio”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
required | Recording name. The button reads Play label. |
duration |
string |
required | Formatted duration, such as 00:28. |
waveform |
number[] |
decorative pattern | Bar heights from 0 to 1. |
className applies to the player row. Other native audio props, such as src, are forwarded.
Pass track elements as children.
Message.LinkPreview
Section titled “Message.LinkPreview”| Prop | Type | Default | Description |
|---|---|---|---|
href |
string |
required | Link destination. |
image |
string |
— | Open Graph image URL. |
imageAlt |
string |
"" |
Image text alternative. |
children |
ReactNode |
href |
Visible link text. |
Other native a props are forwarded to the link.
Message.LinkMinimal
Section titled “Message.LinkMinimal”| Prop | Type | Default | Description |
|---|---|---|---|
href |
string |
required | Link destination. |
title |
string |
required | Card title. |
description |
string |
— | Card description. |
children |
ReactNode |
href |
Visible link text. |
Other native a props are forwarded to the link.
Message.Typing
Section titled “Message.Typing”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
Typing |
Text announced by the status. |
Other native span props are forwarded.
MessageComposer
Section titled “MessageComposer”| Prop | Type | Default | Description |
|---|---|---|---|
variant |
"minimal" | "medium" |
"minimal" |
Figma composer type. |
Other native form props, including onSubmit, are forwarded. A ref points to the form.
MessageComposer.Input
Section titled “MessageComposer.Input”| Prop | Type | Default | Description |
|---|---|---|---|
submitOnEnter |
boolean |
true |
Enter submits. Shift+Enter always inserts a line. |
Other Text Area props, except label and description, are forwarded.
MessageComposer.Actions
Section titled “MessageComposer.Actions”Native div props are forwarded.
MessageComposer.Tool
Section titled “MessageComposer.Tool”| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
required | Accessible name and tooltip text. |
children |
ReactNode |
required | A 16px icon. |
Other Button props, except variant and size, are forwarded.
MessageComposer.Send
Section titled “MessageComposer.Send”| Prop | Type | Default | Description |
|---|---|---|---|
children |
string |
Send |
Text in medium, and the icon button’s name in minimal. |
Other Button props, except variant and size, are forwarded.
Related foundations: Colors, Typography, and Accessibility.