AIComponentBeta

Message.

Who said it, and what you can do with it.

One turn in a conversation: an article named for its author, an optional avatar, the body, and a row of actions. User messages sit in a bubble on the right; assistant replies flow as plain text.

Make it yours

Preparing the example…

PROPERTIES3

Composition

Anatomy

variant defaults from the author: contained for user, flat otherwise. Actions are a toolbar, so a long transcript costs one Tab stop per message.

Component structure
Message.Root (from, variant) — article aria-label="You" | "Assistant"
├── Message.Avatar — decorative Avatar
├── Message.Content — bubble or flat text
└── Message.Actions — Base UI Toolbar
    └── Message.Action (label) — IconButton + Tooltip

A place to start

Usage

Import the stylesheet once at your application root. This complete example reflects the properties selected above.

Loading example…

Details that make a difference

Examples & states

Visual treatments

Emphasis changes presentation while the primitive keeps behavior.

Example loads as it comes into view.

Loading source…

The finer details

API reference

Generated from Dixy’s local TypeScript interfaces. Native HTML attributes and refs are forwarded. The table covers Dixy’s own options.

MessageRoot

PropType / descriptionDefault
from*"system" | "user" | "assistant"

Who wrote it. Sets alignment, the default surface and the accessible name.

—
variant"flat" | "contained"

How the body sits. "contained" is a bubble; "flat" is plain flowing text, the usual choice for long assistant replies.

contained for user, flat otherwise
aria-labelstring

Accessible name of the message, read when moving between messages.

"You" for user, "Assistant" for assistant, "System" for system

MessageAvatar

PropType / descriptionDefault
srcstring

Image URL.

—
fallbackReactNode

Initials or an icon while the image loads or when it is missing.

—

MessageActions

PropType / descriptionDefault
aria-labelstring

Accessible name of the toolbar.

Message actions

MessageAction

PropType / descriptionDefault
label*string

The action's name: its accessible name and its tooltip.

—
tooltipboolean

Show the label as a tooltip on hover and focus.

true
aria-pressedboolean

The pressed state for toggles such as "Good response".

—
children*ReactElement | ReactNode

—

Built from the same foundations

Styling tokens

Change Theme settings above to compare appearance, accent, neutral, radius, spacing density, motion and direction. Override component aliases on a Theme root so custom properties follow portaled content too. The wrapper merges className, style, refs and render composition with its owning primitive.

TokenPurpose
--dixy-color-background-action-primary-subtleThe component-specific starting point.
--dixy-font-label-mdControl label font and line height; body roles remain readable in text inputs.
--dixy-color-background-selectedSelected surfaces use semantic color across appearances.
--dixy-color-border-focusFocus indication remains visible independently of shadows.
--dixy-spacing-inset-smDensity-aware component padding.
--dixy-motion-transition-feedbackShort state feedback, reduced by the inherited motion setting.
Explore theme customization

Consider everyone

Accessibility

Each message is an article whose name says who wrote it, so screen reader users can move between turns. The avatar is hidden because the name already identifies the author. Every action has a label that is both its accessible name and its tooltip; toggles such as Good response use aria-pressed.

TabMove into a message's actions, then on to the next message.
Arrow Left / RightMove between actions inside the toolbar.
Enter / SpaceRun the focused action.

Target: WCAG 2.2 AA. Automated tests cover selected behavior; manual screen-reader, contrast, and zoom validation remain part of the release checklist.

THE THINKING BEHIND IT

Build it. Then understand it.

A Toolbar is the right container when the same set of actions repeats many times: roving focus keeps the Tab sequence short without hiding anything.

A token to follow--dixy-color-background-action-primary-subtle

Nothing up our sleeves

Source
UP NEXTResponse