Message Scroller
A Liquid Glass message stream container pairing a neutral concentric transcript layer with a floating Jump capsule.
Liquid Glass Message Scroller separates the scrolling content layer from the floating navigation control: Root and Viewport remain clean, neutral surfaces with concentric corners (rounded-2xl outer frame with 4px inset around a rounded-xl viewport), while Jump floats above the transcript as a concentric capsule with regular and prominent prominence levels.
Preview
Section titled “Preview”<div class="h-80 w-full max-w-lg">
<proto-ui-liquid-glass-message-scroller-root id="lg-chat">
<proto-ui-liquid-glass-message-scroller-viewport>
<div class="flex flex-col gap-3 p-4 pb-16">
<div>
Concentric neutral transcript layer beneath a floating
Jump capsule.
</div>
</div>
</proto-ui-liquid-glass-message-scroller-viewport>
<proto-ui-liquid-glass-message-scroller-jump>
Jump to latest ↓
</proto-ui-liquid-glass-message-scroller-jump>
</proto-ui-liquid-glass-message-scroller-root>
</div>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Import the prototypes directly from @proto.ui/prototypes-liquid-glass/message-scroller and adapt them for your target runtime.
import { messageScrollerRoot, messageScrollerViewport, messageScrollerJump,} from '@proto.ui/prototypes-liquid-glass/message-scroller';Place Root inside a height-constrained container so messages scroll cleanly beneath the floating capsule control:
<div className="h-80 w-full max-w-lg"> <LiquidGlassMessageScrollerRoot a11yLabel="Design conversation"> <LiquidGlassMessageScrollerViewport> <div className="flex flex-col gap-3 p-4 pb-16"> {messages.map((message) => ( <div key={message.id}>{message.text}</div> ))} </div> </LiquidGlassMessageScrollerViewport> <LiquidGlassMessageScrollerJump variant="regular"> Jump to latest ↓ </LiquidGlassMessageScrollerJump> </LiquidGlassMessageScrollerRoot></div>Layering & Contrast Guidelines
Section titled “Layering & Contrast Guidelines”- Keep content surfaces neutral:
RootandViewportnever apply glass over transcript text, keeping long threads legible and avoiding glass-on-glass stacking. - Prominence hierarchy (
regularvsprominent): Usevariant="regular"while caught up, and promote tovariant="prominent"whennewContentCount > 0while scrolled up. - Readable disabled contrast: Disabling
Jumpwithdraws shadow elevation and pointer interaction while keeping paired surface/ink contrast intact instead of applyingopacity-50. - Focus preservation: Activating
Jumpscrolls smoothly to the latest message without stealing keyboard focus.
Examples
Section titled “Examples”Live Messages & Prominence
Section titled “Live Messages & Prominence”Click Send reply at the bottom to watch automatic end-following. Scroll up first and send again to increment newContentCount and promote the floating capsule from regular to prominent.
<div class="h-72 w-full max-w-lg">
<proto-ui-liquid-glass-message-scroller-root id="lg-live">
<proto-ui-liquid-glass-message-scroller-viewport>
<div
id="lg-messages"
class="flex flex-col gap-3 p-4 pb-16"
></div>
</proto-ui-liquid-glass-message-scroller-viewport>
<proto-ui-liquid-glass-message-scroller-jump id="lg-jump">
Jump to latest ↓
</proto-ui-liquid-glass-message-scroller-jump>
</proto-ui-liquid-glass-message-scroller-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#lg-jump'), {
variant: 'prominent',
});
</script>Prominence & Disabled Contrast
Section titled “Prominence & Disabled Contrast”Toggle between variant="regular" and variant="prominent" or disable Jump to verify readable contrast over rich backdrops.
<div class="h-60 w-full max-w-lg">
<proto-ui-liquid-glass-message-scroller-root id="lg-prom">
<proto-ui-liquid-glass-message-scroller-viewport>
<div class="flex flex-col gap-2.5 p-4 pb-16">
<div>
Toggle variant="regular" vs "prominent" and disabled
contrast.
</div>
</div>
</proto-ui-liquid-glass-message-scroller-viewport>
<proto-ui-liquid-glass-message-scroller-jump id="lg-prom-jump">
2 new notes ↓
</proto-ui-liquid-glass-message-scroller-jump>
</proto-ui-liquid-glass-message-scroller-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#lg-prom-jump'), {
variant: 'prominent',
disabled: false,
});
</script>| Prop | Type | Default |
|---|---|---|
newContentCount | number | 0 |
a11yLabel | string | 'Messages' |
Viewport
Section titled “Viewport”| Expose | Type | Notes |
|---|---|---|
atEnd | ExposeState<boolean> | Whether the viewport is currently at the bottom |
following | ExposeState<ScrollEndFollowState> | Current end-follow state |
requestStatus | ExposeState<ScrollEndFollowRequestStatus> | Status of the latest end-follow request |
jumpToEnd() | () => void | Programmatically scroll to the end |
pauseFollowing() | () => ScrollSurfaceRequestOutcome | Pause automatic end-following |
| Prop / Expose | Type | Default |
|---|---|---|
variant | 'regular' 'prominent' | 'regular' |
disabled | boolean | false |
atEnd (expose) | ExposeState<boolean> | Mirrored bottom state from Root |
newContentCount (expose) | ExposeState<number> | Mirrored new-content count from Root |