Bubble
A chat message in a bubble that shows who sent it.
Left out of Brand expressive Brand expressive keeps only the parts in use for one action and a story, not a part for one campaign. A back-and-forth chat is neither. Use instead: Card, Avatar
See it live
npm run storybookWhen to use it
- 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
- Headlines are short and bold. Three to six words.
- Verbs that move: Join, Try, Go.
- Playful in headlines, plain in errors.
- Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.
The labels components use, from the voice tokens:
content.action.commit: Gocontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Explore the drop
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.
Brand expressive 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.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Them | ||
| Fill Changes with theme | component.bubble.them.backgroundcolor.surface.sunkenvar(--bubble-them-background) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Text Changes with theme | component.bubble.them.labelcolor.text.primaryvar(--bubble-them-label) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Me | ||
| Fill Changes with theme | component.bubble.me.backgroundcolor.action.primaryvar(--bubble-me-background) | Lightpink.light.600:#D61F7ADarkpink.dark.600:#F59ACA |
| Text Changes with theme | component.bubble.me.labelcolor.text.on-actionvar(--bubble-me-label) | Lighttaupe.light.0:#FFFFFFDarktaupe.light.900:#1F1411 |
| Bubble | ||
| Gap | component.bubble.gapspace.gap.tightvar(--bubble-gap) | space.8:0.5rem |
| Text size | component.bubble.font-sizetype.caption.font-sizevar(--bubble-font-size) | font.size.14:0.875rem |
| Text Changes with theme | component.bubble.labelcolor.text.mutedvar(--bubble-label) | Lighttaupe.light.600:#6B544ADarktaupe.dark.400:#B5988A |
| Body | ||
| Corner | component.bubble.body.radiusradius.containervar(--bubble-body-radius) | radius.24:1.5rem |
| Padding, left and right | component.bubble.body.padding-xcomponent-spacing-map.x3var(--bubble-body-padding-x) | space.24:1.5rem |
| Padding, top and bottom | component.bubble.body.padding-ycomponent-spacing-map.x2var(--bubble-body-padding-y) | space.8:0.5rem |
| Text size | component.bubble.body.font-sizetype.body.font-sizevar(--bubble-body-font-size) | font.size.17:1.0625rem |