---
id: portfolio.ds.chat-user-message
name: "Chat User Message"
type: component
status: active
relations: [{"type":"related_to","target":"portfolio.ds.chat-message-list"},{"type":"related_to","target":"portfolio.ds.chat-assistant-message"},{"type":"supersedes","target":"portfolio.ds.chat-user-message-old"},{"type":"uses_token","target":"portfolio.ds.spacing"},{"type":"uses_token","target":"portfolio.ds.max-widths"},{"type":"uses_token","target":"portfolio.ds.primitive-scale"},{"type":"uses_token","target":"portfolio.ds.typography"}]
sources: ["packages/design-system/src/components/ChatUserMessage.astro","apps/portfolio-site/src/design-system/docs/chat-user-message.astro","apps/portfolio-site/src/lib/designSystemRegistry.ts"]
catalog: ["apps/portfolio-site/src/design-system/docs/chat-user-message.astro"]
previews: ["apps/portfolio-site/src/design-system/docs/chat-user-message.astro"]
---
# Chat User Message

## Purpose
The private user-message bubble owned by Chat Message List, rendering literal text without a visible author caption.

## Contract
- Use only as a private user-role child of Chat Message List. Pages and other product components must not consume it directly. The isolated Design System Preview is allowed for documentation and review, not as another product use.
- In the Design System catalog, its standalone entry is a child of Chat Message List below the static separator. Catalog placement matches runtime ownership, and its canonical URL remains flat.
- Props are `text`, accessible `label` and optional `id`; role is fixed to user and is not a prop or Preview switcher.
- The outer article owns semantic left/right Block spacing and zero top/bottom padding. The bubble hugs content, aligns right and uses `--measure-rich-text-copy`, matching Chat Assistant Message.
- Bubble background uses `--color-bg-secondary`, radius uses `--radius-sm` and inner padding uses `--primitive-space-4`.
- Message text uses the Body typography role and `--color-text`, preserves newlines and wraps long words without truncation.
- `data-role`, `data-message-id` and the accessible label stay on the article. `data-chat-text` stays on the paragraph so server-rendered and dynamically cloned messages share the same structure.
- Static literal text only, without reveal animation, visible author caption, Markdown, arbitrary HTML or provider logic.

## Props
| Prop | Default | Responsibility |
| --- | --- | --- |
| `text` | `Message text` | Literal message content. |
| `label` | `Message author` | Accessible author name. |
| `id` | omitted | Optional history identifier. |

## Use
- Use only inside Chat Message List. The isolated Design System Preview is the documentation exception.

## Do Not Use
- Do not consume this private child directly from pages or other product components.
- Do not render assistant messages, add a role prop, make the bubble interactive or add assistant loading/reveal behavior.
- Do not override its spacing, typography, colors or geometry from a parent.

## Accessibility
- Preserve the article's localized accessible author label. Only the message text is visible.
- Preserve literal text and complete-message reading order inside the owning live log.

## Verification
- Check short, long and multiline text, right alignment, the 20% left reserve and overflow at every breakpoint.
- Check identical server-rendered and dynamically appended structure and styling.
- Confirm the Preview uses the component's abstract defaults without product conversation content.

## Enabled Profile Records
- Registry ID: chat-user-message.
- Canonical route: /design-system/chat-user-message/.
- Media: no new source or delivery assets.
