tsimport {XDSChatSystemMessage} from '@xds/core/Chat'
| Guidance | Practices |
|---|---|
| Do | Compose messages using MessageList > Message > Bubble for consistent sender-aware styling and density. |
| Do | Set the density prop to control spacing globally — compact for sidebars, balanced for most views, spacious for long-form reading. Individual messages can override. |
| Do | Use the group prop on bubbles (first, middle, last) when a single sender sends multiple consecutive messages — it tightens corner radius to visually connect them. |
| Do | Use XDSChatSystemMessage with variant="divider" for date separators and default for inline status notices like joins, leaves, or topic changes. |
| Do | Put name on the first bubble and metadata on the last bubble in a message so they align with the bubble's inline padding. |
| Do | Provide an emptyState prop so new users see a clear prompt to start a conversation instead of a blank screen. |
| Do | Use the ghost bubble variant for AI-style responses that show rich content like code blocks or markdown without a visible boundary. |
| Don't | Don't use XDSChatSystemMessage for sender content — it has no avatar, alignment, or bubble. Use XDSChatMessage with a sender role instead. |
| Don't | Don't put long or multi-line content in a system message — keep it to a single short sentence. If you need more, use a bubble or a card. |
| Don't | Don't nest XDSChatMessage inside another XDSChatMessage — each message is a standalone article element with its own sender context. |
| Don't | Don't apply a fixed height directly on the message list — wrap it in a sized container and let the list fill with flex: 1. |
| Don't | Don't mix filled and ghost bubble variants within the same sender's messages — pick one style per side and use it consistently. |
| Don't | Don't place metadata or names on both the bubble and the message wrapper — pick one based on whether the content has a bubble boundary. |
tsx'use client';import {XDSChatMessageList, XDSChatSystemMessage} from '@xds/core/Chat';import {XDSIcon} from '@xds/core/Icon';import {XDSStack} from '@xds/core/Layout';import {XDSText} from '@xds/core/Text';import {LockClosedIcon,ShieldCheckIcon,SparklesIcon,UserPlusIcon,} from '@heroicons/react/24/outline';export default function ChatSystemMessageWithIcon() {return (<XDSStack direction="vertical" gap={4}><XDSText type="supporting" color="secondary">Icons reinforce the message type</XDSText><XDSChatMessageList><XDSChatSystemMessage icon={<XDSIcon icon={UserPlusIcon} />}>Jordan was added to the conversation</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={LockClosedIcon} />}>Messages are end-to-end encrypted</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={SparklesIcon} />}>Agent is generating a response…</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={ShieldCheckIcon} />}>Conversation verified by admin</XDSChatSystemMessage></XDSChatMessageList></XDSStack>);}
tsx'use client';import {XDSChatMessageList, XDSChatSystemMessage} from '@xds/core/Chat';import {XDSIcon} from '@xds/core/Icon';import {CheckCircleIcon,UserMinusIcon,UserPlusIcon,} from '@heroicons/react/24/outline';export default function ChatSystemMessageStatusUpdates() {return (<XDSChatMessageList><XDSChatSystemMessage variant="divider">March 14, 2026</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={UserPlusIcon} />}>Sarah Chen joined the conversation</XDSChatSystemMessage><XDSChatSystemMessage>Topic changed to "Q2 Launch Planning"</XDSChatSystemMessage><XDSChatSystemMessage variant="divider">March 15, 2026</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={UserMinusIcon} />}>Alex Rivera left the conversation</XDSChatSystemMessage><XDSChatSystemMessage variant="divider">Today</XDSChatSystemMessage><XDSChatSystemMessage icon={<XDSIcon icon={CheckCircleIcon} />}>Conversation marked as resolved</XDSChatSystemMessage></XDSChatMessageList>);}
tsx'use client';import {XDSChatMessageList, XDSChatSystemMessage} from '@xds/core/Chat';import {XDSStack} from '@xds/core/Layout';import {XDSText} from '@xds/core/Text';export default function ChatSystemMessageVariants() {return (<XDSStack direction="vertical" gap={4}><XDSStack direction="vertical" gap={1}><XDSText type="supporting" color="secondary">Default</XDSText><XDSChatMessageList><XDSChatSystemMessage>Alex joined the conversation</XDSChatSystemMessage><XDSChatSystemMessage>Conversation marked as resolved</XDSChatSystemMessage></XDSChatMessageList></XDSStack><XDSStack direction="vertical" gap={1}><XDSText type="supporting" color="secondary">Divider</XDSText><XDSChatMessageList><XDSChatSystemMessage variant="divider">March 15, 2026</XDSChatSystemMessage><XDSChatSystemMessage variant="divider">Today</XDSChatSystemMessage></XDSChatMessageList></XDSStack></XDSStack>);}
tsx'use client';import {XDSChatMessageList, XDSChatSystemMessage} from '@xds/core/Chat';export default function ChatSystemMessageShowcase() {return (<XDSChatMessageList><XDSChatSystemMessage variant="divider">March 15, 2026</XDSChatSystemMessage><XDSChatSystemMessage>Alex joined the conversation</XDSChatSystemMessage><XDSChatSystemMessage>Agent is thinking…</XDSChatSystemMessage><XDSChatSystemMessage variant="divider">Today</XDSChatSystemMessage><XDSChatSystemMessage>Conversation marked as resolved</XDSChatSystemMessage></XDSChatMessageList>);}