OTTODesign System

Components

Chat bubble

The chat bubble presents an individual message within a conversation, providing optional contextual details such as the sender’s name, date, and time to help users understand who said what and when.

Configurator

LiveChat bubble: variant, overline and message
Deine Bestellung ist unterwegs und voraussichtlich morgen bei dir.
HTML
<div style="display:flex;flex-direction:column"><oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-01-15T12:34">Deine Bestellung ist unterwegs und voraussichtlich morgen bei dir.</oc-chat-bubble-v1></div>

Usage

Anatomy

Hallo! Ich bin dein OTTO Service. Wie kann ich dir bei deiner Bestellung helfen?
LiveAnatomy
HTML
<div class="on-frame" style="display:flex;justify-content:center;padding:40px 16px"><div style="width:300px;display:flex;flex-direction:column"><oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-01-01T12:34">Hallo! Ich bin dein OTTO Service. Wie kann ich dir bei deiner Bestellung helfen?</oc-chat-bubble-v1></div></div>

Variants

The chat bubble has the following two variants to define the message’s alignment and visual role within the conversation flow.

  • Sent: Messages are right‑aligned to reflect the user’s own output.
  • Received: Messages appear left‑aligned to represent incoming communication.

received

Hallo! Wie kann ich dir helfen?

sent

Wo ist meine Bestellung?
LiveMessage variants
HTML
<oc-chat-bubble-v1 variant="received">Hallo! Wie kann ich dir helfen?</oc-chat-bubble-v1>
<oc-chat-bubble-v1 variant="sent">Wo ist meine Bestellung?</oc-chat-bubble-v1>

Overline

In addition to alignment, the component supports flexible control of the overline:

It can be fully shown/hidden or configured to show only the sender name, the time or the combination of date and time. This allows to adjust the level of contextual information for the chat while keeping the conversation clean and readable. Messages sent within the last week show the day of the week (e.g. monday). From the sixth day onwards, the display switches from the day of the week to the full calendar date.

Deine Bestellung ist unterwegs.

hidden overline

Deine Bestellung ist unterwegs.

overline with sender

Deine Bestellung ist unterwegs.

overline with time

Deine Bestellung ist unterwegs.

overline with datetime (weekday within the last week)

Deine Bestellung ist unterwegs.

overline with sender & time

Deine Bestellung ist unterwegs.

overline with sender & datetime

LiveOverline variants
HTML
<div class="on-frame" style="display:grid;grid-template-columns:minmax(0,300px) 1fr;gap:24px 40px;align-items:center;padding:24px 16px">
<oc-chat-bubble-v1 variant="received">Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">hidden overline</p>
<oc-chat-bubble-v1 variant="received" sender="OTTO Service">Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">overline with sender</p>
<oc-chat-bubble-v1 variant="received" timestamp="2026-01-01T12:34" hide-date>Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">overline with time</p>
<oc-chat-bubble-v1 variant="received" timestamp="2026-01-01T12:34">Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">overline with datetime (weekday within the last week)</p>
<oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-01-01T12:34" hide-date>Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">overline with sender &amp; time</p>
<oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-01-01T12:34">Deine Bestellung ist unterwegs.</oc-chat-bubble-v1><p class="demo-label">overline with sender &amp; datetime</p>

Behaviour

Fitting

The width of the chat bubble uses fit-content.

Deine Bestellung wurde heute an Hermes übergeben und ist voraussichtlich morgen bei dir. Super, danke!
LiveFit-content
HTML
<oc-chat-bubble-v1 variant="received" sender="OTTO Service">Deine Bestellung wurde heute an Hermes übergeben und ist voraussichtlich morgen bei dir.</oc-chat-bubble-v1>
<oc-chat-bubble-v1 variant="received">Super, danke!</oc-chat-bubble-v1>

The chat bubble spans up to 80% of the chat container to the left or right side depending on the variant. When the content reaches the width threshold, the text automatically wraps onto the next line without hyphenation.

chat viewport · bubbles up to 80 %

Hallo! Deine Bestellung wurde heute an Hermes übergeben und ist voraussichtlich morgen bei dir. Super, danke! Kann ich die Lieferung auch an eine Packstation umleiten? Na klar, das geht.
LiveFitting within a chat
HTML
<div class="on-frame" style="display:flex;justify-content:center;padding:24px 16px"><div style="width:100%;max-width:360px;border:1px solid #d6d6d6;border-radius:16px;overflow:hidden;background:#f0f0f0">
<div style="background:#fff;padding:12px 8px"><oc-icon-button-v3 icon="arrow-left" variant="transparent" oc-aria-label="Zurück"></oc-icon-button-v3></div>
<div style="display:flex;flex-direction:column;gap:12px;padding:16px">
  <p class="demo-label" style="text-align:center">chat viewport · bubbles up to 80 %</p>
  <oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-09-25T09:33" hide-date>Hallo! Deine Bestellung wurde heute an Hermes übergeben und ist voraussichtlich morgen bei dir.</oc-chat-bubble-v1>
  <oc-chat-bubble-v1 variant="sent" timestamp="2026-09-25T09:34" hide-date>Super, danke! Kann ich die Lieferung auch an eine Packstation umleiten?</oc-chat-bubble-v1>
  <oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-09-25T09:35" hide-date>Na klar, das geht.</oc-chat-bubble-v1>
</div>

Best practices

Deine Bestellung wurde heute an Hermes übergeben und ist voraussichtlich morgen bei dir. Super, danke! Kann ich die Lieferung auch an eine Packstation umleiten?
CautionChange the background and text colors according to our accessibility guidelines.

Accessibility

Implementation

Live demo

OTTO KundenserviceOnline, antwortet meist sofort
Hallo Lara! Wie kann ich dir helfen? Mein Sessel sollte heute kommen, ich sehe aber noch keine Sendungsnummer. Ich hab nachgeschaut: Dein Sessel ist bei der Spedition und kommt morgen zwischen 10 und 14 Uhr. Die Spedition ruft dich vorher an.
Nachricht
LiveReal OTTO components, rendered by the OTTO component runtime
HTML
<div class="on-frame" style="padding:32px 16px">
<div style="width:100%;max-width:390px;margin:0 auto;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.08)">
<div style="display:flex;align-items:center;gap:8px;padding:8px"><oc-icon-button-v3 icon="arrow-left" variant="transparent" oc-aria-label="Zurück"></oc-icon-button-v3><div style="display:grid"><span class="oc-copy-100" style="font-weight:700">OTTO Kundenservice</span><span class="oc-copy-75" style="color:var(--oc-semantic-color-text-success)">Online, antwortet meist sofort</span></div></div>
<oc-divider-v1 in-flow></oc-divider-v1>
<div style="display:flex;flex-direction:column;gap:12px;padding:16px;background:var(--oc-semantic-color-background-frame,#f0f0f0)">
  <oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-09-25T09:32" hide-date>Hallo Lara! Wie kann ich dir helfen?</oc-chat-bubble-v1>
  <oc-chat-bubble-v1 variant="sent" timestamp="2026-09-25T09:33" hide-date>Mein Sessel sollte heute kommen, ich sehe aber noch keine Sendungsnummer.</oc-chat-bubble-v1>
  <oc-chat-bubble-v1 variant="received" sender="OTTO Service" timestamp="2026-09-25T09:34" hide-date>Ich hab nachgeschaut: Dein Sessel ist bei der Spedition und kommt morgen zwischen 10 und 14 Uhr. Die Spedition ruft dich vorher an.</oc-chat-bubble-v1>
<oc-chip-v3><button>Termin ändern</button></oc-chip-v3><oc-chip-v3><button>Danke, passt!</button></oc-chip-v3></div>
<div style="display:flex;align-items:center;gap:8px;padding:12px 16px"><div style="flex:1"><oc-text-field-v1 placeholder="Nachricht schreiben">Nachricht</oc-text-field-v1></div><oc-icon-button-v3 icon="paper-plane" variant="primary" oc-aria-label="Nachricht senden"></oc-icon-button-v3></div>

Code

Version Tag Status API
v1 <oc-chat-bubble-v1> Stable ChatBubbleV1

API

API: <oc-chat-bubble-v1> (ChatBubbleV1)

Chat Bubble is a component that represents a single message in a chat interface. It can be styled as either a sent or received message, and can display the sender's name and timestamp. The component also allows for customization of background and text colors through CSS variables.

Attributes / properties
Attribute Type Default Required Description
variant "sent" | "received" "sent" no Sets the main styling variant of the chat bubble.
sender string undefined no Sets the sender's name, which is displayed above the chat bubble content.
timestamp string undefined no Displays the timestamp of the message when it was created, in ISO format (e.g. 2026-01-15T13:37).

This string is parsed and formatted depending on the distance to today.
hide-date boolean false no Indicates whether the date should be hidden and only the time should be displayed. Set to true to hide the date and show only the time in the timestamp.
Slots
Slot Required Description
default yes Sets the main content of the chat bubble.
Events
Event Detail type Description
oc-property-change OcChatBubbleV1Events["oc-property-change"] Whenever a property value changes, this event triggers. Use this event to track all property changes within the component.

Refer to the Events documentation for more information.
oc-mount { component: string; } Fired when the component is mounted to the DOM. The event is fired when the onMount hook of the component is called by the runtime.
oc-unmount { component: string; } Fired when the component is unmounted from the DOM. The event is fired when the function returned by the onMount hook of the component is called by the runtime.
CSS custom properties
Custom property Default Description
--background-color undefined Sets a custom background color through a CSS variable.
Note: The preferred way of using colors is via Design Tokens instead of hex values.
--text-color undefined Sets a custom text color through a CSS variable.
Note: The preferred way of using colors is via Design Tokens instead of hex values.
--custom-spacing-x undefined Sets the custom horizontal spacing of the chat bubble.
--custom-spacing-y undefined Sets the custom vertical spacing of the chat bubble.
--border-radius undefined Sets the custom border radius of the chat bubble.

Examples

Listed below are the most common variations of the chat bubble component as well as specific component variations for different use cases.

Default

The default chat bubble component uses the sent variant that aligns the bubble to the right.

DETACH TO REPLACE CONTENT
HTML
<oc-chat-bubble-v1>
<oc-placeholder-v1 style="height: 100px;">DETACH TO REPLACE CONTENT</oc-placeholder-v1>
</oc-chat-bubble-v1>
Received

The received variant aligns the bubble to the left.

DETACH TO REPLACE CONTENT
HTML
<oc-chat-bubble-v1 variant="received">
<oc-placeholder-v1 style="height: 100px;">DETACH TO REPLACE CONTENT</oc-placeholder-v1>
</oc-chat-bubble-v1>
Received with sender and timestamp

The received variant with sender and timestamp.

DETACH TO REPLACE CONTENT
HTML
<oc-chat-bubble-v1 variant="received" sender="Absender" timestamp="2026-01-01T01:01">
<oc-placeholder-v1 style="height: 100px;">DETACH TO REPLACE CONTENT</oc-placeholder-v1>
</oc-chat-bubble-v1>
Demo: Custom background color

Demo: Custom background color

Hier steht ein sehr langer Probetext über zwei beste Freunde, die einen tollen Chat-Verlauf haben.
HTML
<oc-chat-bubble-v1
variant="received"
sender="Absender"
timestamp="2026-01-01T12:34"
style="--background-color: var(--oc-semantic-color-background-soft-mint)"
>Hier steht ein sehr langer Probetext über zwei beste Freunde, die einen tollen Chat-Verlauf
haben.</oc-chat-bubble-v1
>
Demo: Custom background color and text color

Demo: Custom background color and text color

Hier steht ein sehr langer Probetext über zwei beste Freunde, die einen tollen Chat-Verlauf haben.
HTML
<oc-chat-bubble-v1
variant="received"
sender="Absender"
timestamp="2026-01-01T12:34"
style="--background-color: var(--oc-semantic-color-background-strong-blue); --text-color: var(--oc-semantic-color-text-inverted)"
>Hier steht ein sehr langer Probetext über zwei beste Freunde, die einen tollen Chat-Verlauf
haben.</oc-chat-bubble-v1
>