Message scroller
A scrolling list of messages that keeps the newest in view.
Left out of Multi-brand Multi-brand draws on core, content and media families, not conversation. It admits only families in its roles. Its only messages go to support through a textarea. Use instead: Textarea
See it live
npm run storybookWhen to use it
- Use it when: A live conversation where new messages arrive at the bottom.
- Not when: A static list (a scroll area).
Instead:
- Scroll area: A plain scrolling region.
Words
- Shared structure: object, state, next step.
- Brand tone lives in headlines and marketing copy, not in errors.
- Errors and confirmations read the same in every brand.
- Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.
The labels components use, from the voice tokens:
content.action.commit: Savecontent.action.cancel: Cancelcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Get started
See Voice and tone for the whole voice.
Accessibility and keyboard
Test before you ship:
- New messages are announced politely without moving focus. undefined
Use it in code
npx open-ds add message-scroller
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Message scroller reads 5 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 Message scroller's tokens to change Message scroller alone.
Multi-brand decides what changes when you switch theme. Here a switch changes colors, type and shape, so the marked rows differ between its brands and between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Message scroller | ||
| Gap | component.message-scroller.gapspace.gap.groupvar(--message-scroller-gap) | space.24:1.5rem |
| Corner Changes with theme | component.message-scroller.radiusradius.controlvar(--message-scroller-radius) | Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px |
| Focus on focus | component.message-scroller.focusborder-width.focusvar(--message-scroller-focus) | border-width.2:2px |
| Focus ring focus Changes with theme on focus | component.message-scroller.focus-ring-focuscolor.border.focusvar(--message-scroller-focus-ring-focus) | Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F |
| Focus ring offset focus Changes with theme on focus | component.message-scroller.focus-ring-offset-focuscolor.surface.canvasvar(--message-scroller-focus-ring-offset-focus) | Aster Lightslate-deep.light.50:#F8FAFCAster Darkslate-deep.dark.0:#020617Birch Lightslate-deep.light.50:#F8FAFCBirch Darkslate-deep.dark.0:#020617Coral Lightslate-deep.light.50:#F8FAFCCoral Darkslate-deep.dark.0:#020617 |