Skip to main content

Bubble

A chat message in a bubble that shows who sent it.

In Dense data

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Dense data: A back-and-forth between analysts or with an assistant. Not for notes on an alert, which use a message.

  • Use it when: A back-and-forth conversation between people or with an assistant.
  • Not when: Comments on a page or long text (use a message or a card).

Instead:

  • Message: One message with its author and time, without the bubble shape.

Words​

  • Lead with the object, then the state: "Alert 2041 contained."
  • Use numbers, not words for numbers.
  • One verb per button. No "please", no exclamation marks.
  • Use: Investigate, Filter, Assign, Escalated, Resolved. Avoid: Oops, Awesome, Please, Simply.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Delete
  • content.action.retry: Retry
  • content.action.empty-action: Change filters

See Voice and tone for the whole voice.

Use it in code​

npx open-ds add bubble

The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.

Tokens it reads​

Bubble reads 11 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Bubble's tokens to change Bubble alone.

Changes with theme

Dense data decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.

PartIts token and the semantic it aliasesValue
Them
Fill
Changes with theme
component.bubble.them.backgroundcolor.surface.sunkenvar(--bubble-them-background)Lightslate.light.100:#EEF1F5Darkslate.dark.100:#262D38
Text
Changes with theme
component.bubble.them.labelcolor.text.primaryvar(--bubble-them-label)Lightslate.light.900:#161B23Darkslate.dark.900:#F7F8FA
Me
Fill
Changes with theme
component.bubble.me.backgroundcolor.action.primaryvar(--bubble-me-background)Lightviolet.light.600:#4B3FD9Darkviolet.dark.600:#A9A3F6
Text
Changes with theme
component.bubble.me.labelcolor.text.on-actionvar(--bubble-me-label)Lightslate.light.0:#FFFFFFDarkslate.light.900:#161B23
Bubble
Gapcomponent.bubble.gapspace.gap.tightvar(--bubble-gap)space.4:0.25rem
Text sizecomponent.bubble.font-sizetype.caption.font-sizevar(--bubble-font-size)font.size.12:0.75rem
Text
Changes with theme
component.bubble.labelcolor.text.mutedvar(--bubble-label)Lightslate.light.600:#535D6DDarkslate.dark.400:#969FAD
Body
Cornercomponent.bubble.body.radiusradius.containervar(--bubble-body-radius)radius.4:0.25rem
Padding, left and rightcomponent.bubble.body.padding-xcomponent-spacing-map.x3var(--bubble-body-padding-x)space.12:0.75rem
Padding, top and bottomcomponent.bubble.body.padding-ycomponent-spacing-map.x2var(--bubble-body-padding-y)space.8:0.5rem
Text sizecomponent.bubble.body.font-sizetype.body.font-sizevar(--bubble-body-font-size)font.size.14:0.875rem