ClickorKeyboard shortcut Alt + L

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsAccessibilityColor SystemColor UtilitiesPrinciplesFigma ToolkitGridIconographyNamingNordhealth BrandTypographyThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBannerButtonButton GroupCalendarCard Updated Chart New Chat New Chat AttachmentChat ComposerChat Composer DrawerChat Composer InputChat Dictation ButtonChat Layout Scroll ButtonChat MessageChat Message BubbleChat Message ListChat Message MetadataChat Send ButtonChat System MessageChat TokenChat Tokenized TextChat Tool CallsCheckboxCollapsible New Combobox New Command MenuData Table New Date PickerDate Range Picker New DividerDrawer Updated DropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInputInput Group New Item New Kbd New LayoutMessageMeter New Modal Updated NavigationNotificationNumber Field New Otp Field New Outline New Overflow List New Pagination New PopoutProgressProgress BarQrcodeRadioRangeResizable New Rich Text Editor New Scroll Area New Segmented ControlSelectSkeletonSpinnerStackTabTableTagTextareaTime Picker New Timestamp New ToastToggleTooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Clickto expandKeyboard shortcut Alt + L

Chat Message Bubble Alpha Light DOM & Tailwind

Styles one sender-aware message fragment with Nord semantic variants and grouping.

This component is considered alpha. We're still finalising the API, so it may include a breaking change at any time — use it at your own risk.

Usage

Chat Message Bubble presents a single consumer-owned fragment inside a Chat Message. See the Chat family guide for complete turn and conversation composition.

import "@nordhealth/components/lib/ChatMessageBubble"

Composition

Chat Message Bubble is a presentational fragment within Chat Message. It inherits sender and density context from the surrounding turn, owns the surface variant and grouping treatment, and leaves the semantics and behavior of its consumer content unchanged.

Examples

Variants and grouping

Use variant="filled", ghost, or error to match the message state. For consecutive fragments from one sender, set group to first, middle, and last; only the sender-side corners tighten. Sender alignment and compact, balanced, or spacious density are inherited from the nearest Chat Message unless explicitly overridden.

Filled incoming messages use the standard Nord surface and strong border. Outgoing messages use the weak information surface and information border, with the flat corner mirrored using logical properties in RTL. The default message measure is 20rem; override --n-chat-message-bubble-max-inline-size when a product needs a different conversation measure.

Accessibility

The bubble is presentational and does not replace the semantics of its content. Keep links, controls, lists, and structured text as real elements inside it. Error treatment includes semantic text/color roles, but the message copy should still explain the failure without relying on color alone.

API reference

ChatMessageBubble

Chat Message Bubble styles one consumer-owned message fragment using sender and density values inherited privately from Chat Message.

<nord-chat-message-bubble></nord-chat-message-bubble>

Props

PropertyAttribute Description TypeDefault
variantvariantVisual treatment for the bubble.ChatMessageBubbleVariant'filled'
groupgroupPosition within a consecutive group of bubbles from the same sender.ChatMessageBubbleGroup | undefined

Slots

Slot name Description
Default slotMessage content.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-chat-message-bubble-max-inline-sizeMaximum message measure.70ch
--n-chat-message-bubble-paddingInner message spacing.var(--n-space-s) var(--n-space-m)
--n-chat-message-bubble-border-widthMessage border width.1px
--n-chat-message-bubble-border-styleMessage border style.solid
--n-chat-message-bubble-border-colorMessage border color.var(--n-color-border-strong)
--n-chat-message-bubble-border-radiusMessage corner radius.var(--n-border-radius)
--n-chat-message-bubble-connected-border-radiusCorner radius where grouped messages connect.var(--n-border-radius-sharp)
--n-chat-message-bubble-backgroundMessage surface color.var(--n-color-surface)
--n-chat-message-bubble-colorMessage text color.var(--n-color-text)
Light DOM & Tailwind. This component renders in the light DOM, so you can style it directly with your own CSS or Tailwind utility classes — there is no shadow boundary, and its default styles are low specificity, so your utilities win.