Message
Conversation row layout with avatar, header, footer and alignment.
Installation
pnpm dlx nachui add messageAnatomy
Message handles the layout around a message: who sent it, when, and on which side it sits. The surface itself is a Bubble. Every part is a plain element, so the whole row renders on the server.
Composition
Use the following composition to build a
Message:Variants
Grouped
Wrap consecutive messages from the same sender in
Message.Group and stack their bubbles with Bubble.Group, so the avatar and header appear once.API Reference
Message
| Prop | Type | Default | Description |
|---|---|---|---|
align | 'start' | 'end' | 'start' | Side of the conversation; end mirrors the row |
className | string | - | Additional CSS classes |
Message.Avatar
Anchors its child to the bottom of the row. Accepts
className.Message.Content
Column that follows the root alignment. Accepts
className.Message.Header
Sender name and metadata above the bubble. Accepts
className.Message.Footer
Status line below the bubble, e.g. time and read state. Accepts
className.Message.Group
Stacks consecutive messages from the same sender. Accepts
className.Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.