Skip to content

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.

  1. Phoenix Baker

    Hey Olivia, can you please review the latest design?

  2. You

    Sure thing, I’ll have a look today.

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.Send

Every 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.

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.

You
Hey Olivia, can you please review the latest design?

Sure thing, I’ll have a look today.

status is unread, read, or failed. label names the icon and is the tooltip text. Hover or focus an icon to see its tooltip.

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.

Phoenix Baker

Hover this message, or press Tab to reach its actions.

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.

Phoenix Baker

Shipped the new onboarding flow.

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.

You
Tech design requirements.pdf200 KB

Message.Image renders a 4:3 image with an optional file name and size caption. alt is required.

Phoenix Baker
Blurred pastel gradient with an orange and blue streak
Background image.jpg128 KB

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.

Phoenix Baker

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.

Phoenix Baker
00:28

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.

  1. You
    Nesra AI - Future of winning enterprise workflow and organization with AI and automationNesra enables companies in Indonesia to remove repetitive work, see the business clearly through data, and apply practical AI.
    https://www.nesra.ai

Message.Typing renders Figma’s Writing state. The dots bounce only when the user has not asked for reduced motion.

Phoenix Baker
Phoenix Baker is typing

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.

Press Enter to send. Shift+Enter adds a line.

variant="medium" renders a 128px text area. MessageComposer.Actions places the tools and a text Send button at its bottom right.

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.

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-neutral with a Stroke/stroke-border border. Text uses Text/text-body.
  • The reply quote has a 3px Stroke/stroke-brand-primary left edge.
  • The action panel uses Foundation/bg-inverse with Icon/icon-inverse buttons. Tooltips use the inverse roles.
  • Status icons use Icon/icon-muted, and Icon/icon-neutral on hover or focus. Failed uses Icon/icon-destructive.
  • The audio play button uses Foundation/bg-brand-primary with Icon/icon-on-brand.
  • Video overlay buttons use Alpha/black-50 with Backdrop blur/backdrop-blur-md and Icon/icon-staticWhite, so they stay the same in both modes.
  • Links use Text/text-link.
  • Message.List is an ol. Each Message is an article inside an li, so assistive technology reads messages in order and reports their count.
  • Message.Avatar is hidden from assistive technology because Message.Author names the sender.
  • Message.Status is a focusable image named by label. Focus or hover shows the same text as a tooltip.
  • Message.Actions is a toolbar named Message 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.Reaction is a toggle button with aria-pressed. Its name is label followed by count. The emoji is hidden from assistive technology.
  • Message.Typing is a status region. Give it a label such as Phoenix Baker is typing.
  • Message.Video and Message.Audio require label. Their controls are native buttons. Provide captions or a transcript for recorded speech.
  • MessageComposer.Input is named Message unless you set aria-label or aria-labelledby. Each MessageComposer.Tool requires label.
  • The application owns live announcements of new messages, unread counts, scrolling, and loading older history.
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.

Native ol props are forwarded. A ref points to the list. Give it an aria-label.

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.

Native span props are forwarded. Long names truncate.

Native time props are forwarded. Set dateTime to a machine-readable value.

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.

Native p props are forwarded. Line breaks in the text are preserved.

Native blockquote props are forwarded.

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.

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.

Prop Type Default Description
label string Reactions Accessible group name.

Other native div props are forwarded.

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.

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.

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.

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.

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.

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.

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.

Prop Type Default Description
label string Typing Text announced by the status.

Other native span props are forwarded.

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.

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.

Native div props are forwarded.

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.

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.