Docs Components Advanced

MessageScroller

React example follows below.
ts
const messageScrollerFixture = {
id: "message-scroller",
label: "Incident response transcript",
defaultScrollPosition: "last-anchor",
messages: [
{ id: "incident-01", content: "Can you summarize the incident timeline?" },
{
id: "incident-02",
content: "The alert fired at 09:14 after error rates crossed the paging threshold.",
},
{
id: "incident-03",
content: "Was customer traffic affected before the on-call engineer responded?",
},
{
id: "incident-04",
content: "Traffic began shifting to the healthy pool at 09:17.",
},
{ id: "incident-05", content: "What did the first diagnostic check reveal?" },
{
id: "incident-06",
content: "One application pool was returning stale dependency health checks.",
},
{
id: "incident-07",
content: "Start the remediation summary here.",
scrollAnchor: true,
},
{
id: "incident-08",
content: "The unhealthy pool was drained without dropping active requests.",
},
{
id: "incident-09",
content: "Fresh instances joined the load balancer and passed readiness checks.",
},
{ id: "incident-10", content: "Error rates returned to baseline at 09:21." },
{
id: "incident-11",
content: "Synthetic checks confirmed recovery from three regions.",
},
{
id: "incident-12",
content: "Follow-up actions are documented and ready for review.",
},
],
} as const;
import { MessageScroller } from "@grassroot/ui-react/advanced";
export default function MessageScrollerDemo() {
return (
<div className="h-56 w-full max-w-xl" data-testid="message-scroller-demo">
<MessageScroller
messages={messageScrollerFixture.messages}
label={messageScrollerFixture.label}
autoScroll={false}
defaultScrollPosition="start"
showButton={false}
/>
</div>
);
}
ts
<script setup lang="ts">
const messageScrollerFixture = {
id: "message-scroller",
label: "Incident response transcript",
defaultScrollPosition: "last-anchor",
messages: [
{ id: "incident-01", content: "Can you summarize the incident timeline?" },
{
id: "incident-02",
content: "The alert fired at 09:14 after error rates crossed the paging threshold.",
},
{
id: "incident-03",
content: "Was customer traffic affected before the on-call engineer responded?",
},
{
id: "incident-04",
content: "Traffic began shifting to the healthy pool at 09:17.",
},
{ id: "incident-05", content: "What did the first diagnostic check reveal?" },
{
id: "incident-06",
content: "One application pool was returning stale dependency health checks.",
},
{
id: "incident-07",
content: "Start the remediation summary here.",
scrollAnchor: true,
},
{
id: "incident-08",
content: "The unhealthy pool was drained without dropping active requests.",
},
{
id: "incident-09",
content: "Fresh instances joined the load balancer and passed readiness checks.",
},
{ id: "incident-10", content: "Error rates returned to baseline at 09:21." },
{
id: "incident-11",
content: "Synthetic checks confirmed recovery from three regions.",
},
{
id: "incident-12",
content: "Follow-up actions are documented and ready for review.",
},
],
} as const;
import { MessageScroller } from "@grassroot/ui-vue";
</script>
<template>
<div class="h-56 w-full max-w-xl" data-testid="message-scroller-demo">
<MessageScroller
:messages="messageScrollerFixture.messages"
:label="messageScrollerFixture.label"
:auto-scroll="false"
default-scroll-position="start"
:show-button="false"
/>
</div>
</template>
ts
import { Component } from "@angular/core";
const messageScrollerFixture = {
id: "message-scroller",
label: "Incident response transcript",
defaultScrollPosition: "last-anchor",
messages: [
{ id: "incident-01", content: "Can you summarize the incident timeline?" },
{
id: "incident-02",
content: "The alert fired at 09:14 after error rates crossed the paging threshold.",
},
{
id: "incident-03",
content: "Was customer traffic affected before the on-call engineer responded?",
},
{
id: "incident-04",
content: "Traffic began shifting to the healthy pool at 09:17.",
},
{ id: "incident-05", content: "What did the first diagnostic check reveal?" },
{
id: "incident-06",
content: "One application pool was returning stale dependency health checks.",
},
{
id: "incident-07",
content: "Start the remediation summary here.",
scrollAnchor: true,
},
{
id: "incident-08",
content: "The unhealthy pool was drained without dropping active requests.",
},
{
id: "incident-09",
content: "Fresh instances joined the load balancer and passed readiness checks.",
},
{ id: "incident-10", content: "Error rates returned to baseline at 09:21." },
{
id: "incident-11",
content: "Synthetic checks confirmed recovery from three regions.",
},
{
id: "incident-12",
content: "Follow-up actions are documented and ready for review.",
},
],
} as const;
import { GrassrootMessageScroller } from "@grassroot/ui-angular/message-scroller";
@Component({
selector: "app-message-scroller-demo",
standalone: true,
imports: [GrassrootMessageScroller],
host: { style: "display: contents" },
template: `
<div class="h-56 w-full max-w-xl" data-testid="message-scroller-demo">
<grassroot-message-scroller
[messages]="fixture.messages"
[label]="fixture.label"
[autoScroll]="false"
defaultScrollPosition="start"
[showButton]="false"
/>
</div>
`,
})
export class MessageScrollerDemoComponent {
protected readonly fixture = messageScrollerFixture;
}
export default MessageScrollerDemoComponent;
ts
<script lang="ts">
const messageScrollerFixture = {
id: "message-scroller",
label: "Incident response transcript",
defaultScrollPosition: "last-anchor",
messages: [
{ id: "incident-01", content: "Can you summarize the incident timeline?" },
{
id: "incident-02",
content: "The alert fired at 09:14 after error rates crossed the paging threshold.",
},
{
id: "incident-03",
content: "Was customer traffic affected before the on-call engineer responded?",
},
{
id: "incident-04",
content: "Traffic began shifting to the healthy pool at 09:17.",
},
{ id: "incident-05", content: "What did the first diagnostic check reveal?" },
{
id: "incident-06",
content: "One application pool was returning stale dependency health checks.",
},
{
id: "incident-07",
content: "Start the remediation summary here.",
scrollAnchor: true,
},
{
id: "incident-08",
content: "The unhealthy pool was drained without dropping active requests.",
},
{
id: "incident-09",
content: "Fresh instances joined the load balancer and passed readiness checks.",
},
{ id: "incident-10", content: "Error rates returned to baseline at 09:21." },
{
id: "incident-11",
content: "Synthetic checks confirmed recovery from three regions.",
},
{
id: "incident-12",
content: "Follow-up actions are documented and ready for review.",
},
],
} as const;
import { MessageScroller } from "@grassroot/ui-svelte";
</script>
<div class="h-56 w-full max-w-xl" data-testid="message-scroller-demo">
<MessageScroller
messages={messageScrollerFixture.messages}
label={messageScrollerFixture.label}
autoScroll={false}
defaultScrollPosition="start"
showButton={false}
/>
</div>
ts
/** @jsxImportSource solid-js */
const messageScrollerFixture = {
id: "message-scroller",
label: "Incident response transcript",
defaultScrollPosition: "last-anchor",
messages: [
{ id: "incident-01", content: "Can you summarize the incident timeline?" },
{
id: "incident-02",
content: "The alert fired at 09:14 after error rates crossed the paging threshold.",
},
{
id: "incident-03",
content: "Was customer traffic affected before the on-call engineer responded?",
},
{
id: "incident-04",
content: "Traffic began shifting to the healthy pool at 09:17.",
},
{ id: "incident-05", content: "What did the first diagnostic check reveal?" },
{
id: "incident-06",
content: "One application pool was returning stale dependency health checks.",
},
{
id: "incident-07",
content: "Start the remediation summary here.",
scrollAnchor: true,
},
{
id: "incident-08",
content: "The unhealthy pool was drained without dropping active requests.",
},
{
id: "incident-09",
content: "Fresh instances joined the load balancer and passed readiness checks.",
},
{ id: "incident-10", content: "Error rates returned to baseline at 09:21." },
{
id: "incident-11",
content: "Synthetic checks confirmed recovery from three regions.",
},
{
id: "incident-12",
content: "Follow-up actions are documented and ready for review.",
},
],
} as const;
import { MessageScroller } from "@grassroot/ui-solid";
export default function MessageScrollerDemo() {
return (
<div class="h-56 w-full max-w-xl" data-testid="message-scroller-demo">
<MessageScroller
messages={messageScrollerFixture.messages}
label={messageScrollerFixture.label}
autoScroll={false}
defaultScrollPosition="start"
showButton={false}
/>
</div>
);
}

Installation

API Reference

Import

import { MessageScroller } from "@grassroot/ui-react/advanced";

Props

Prop
Type
Default
Requirement
messages
readonly MessageScrollerMessage[] | undefined
optional
autoScroll
boolean | undefined
optional
defaultScrollPosition
MessageScrollerDefaultScrollPosition | undefined
optional
preserveScrollOnPrepend
boolean | undefined
optional
scrollEdgeThreshold
number | undefined
optional
scrollMargin
number | undefined
optional
scrollPreviousItemPeek
number | undefined
optional
buttonDirection
MessageScrollerDirection | undefined
optional
showButton
boolean | undefined
optional
buttonLabel
string | undefined
optional
label
string | undefined
optional
busy
boolean | undefined
optional
Prop
messages
Type
readonly MessageScrollerMessage[] | undefined
Default
Requirement
optional
Prop
autoScroll
Type
boolean | undefined
Default
Requirement
optional
Prop
defaultScrollPosition
Type
MessageScrollerDefaultScrollPosition | undefined
Default
Requirement
optional
Prop
preserveScrollOnPrepend
Type
boolean | undefined
Default
Requirement
optional
Prop
scrollEdgeThreshold
Type
number | undefined
Default
Requirement
optional
Prop
scrollMargin
Type
number | undefined
Default
Requirement
optional
Prop
scrollPreviousItemPeek
Type
number | undefined
Default
Requirement
optional
Prop
buttonDirection
Type
MessageScrollerDirection | undefined
Default
Requirement
optional
Prop
showButton
Type
boolean | undefined
Default
Requirement
optional
Prop
buttonLabel
Type
string | undefined
Default
Requirement
optional
Prop
label
Type
string | undefined
Default
Requirement
optional
Prop
busy
Type
boolean | undefined
Default
Requirement
optional

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { MessageScroller } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
messages
readonly MessageScrollerMessage[] | undefined
() => []
optional
autoScroll
boolean | undefined
messageScrollerDefaults.autoScroll
optional
defaultScrollPosition
MessageScrollerDefaultScrollPosition | undefined
messageScrollerDefaults.defaultScrollPosition
optional
preserveScrollOnPrepend
boolean | undefined
messageScrollerDefaults.preserveScrollOnPrepend
optional
scrollEdgeThreshold
number | undefined
messageScrollerDefaults.scrollEdgeThreshold
optional
scrollMargin
number | undefined
messageScrollerDefaults.scrollMargin
optional
scrollPreviousItemPeek
number | undefined
messageScrollerDefaults.scrollPreviousItemPeek
optional
buttonDirection
MessageScrollerDirection | undefined
messageScrollerDefaults.buttonDirection
optional
showButton
boolean | undefined
messageScrollerDefaults.showButton
optional
buttonLabel
string | undefined
optional
label
string | undefined
messageScrollerDefaults.label
optional
busy
boolean | undefined
false
optional
className
string | undefined
optional
Prop
messages
Type
readonly MessageScrollerMessage[] | undefined
Default
() => []
Requirement
optional
Prop
autoScroll
Type
boolean | undefined
Default
messageScrollerDefaults.autoScroll
Requirement
optional
Prop
defaultScrollPosition
Type
MessageScrollerDefaultScrollPosition | undefined
Default
messageScrollerDefaults.defaultScrollPosition
Requirement
optional
Prop
preserveScrollOnPrepend
Type
boolean | undefined
Default
messageScrollerDefaults.preserveScrollOnPrepend
Requirement
optional
Prop
scrollEdgeThreshold
Type
number | undefined
Default
messageScrollerDefaults.scrollEdgeThreshold
Requirement
optional
Prop
scrollMargin
Type
number | undefined
Default
messageScrollerDefaults.scrollMargin
Requirement
optional
Prop
scrollPreviousItemPeek
Type
number | undefined
Default
messageScrollerDefaults.scrollPreviousItemPeek
Requirement
optional
Prop
buttonDirection
Type
MessageScrollerDirection | undefined
Default
messageScrollerDefaults.buttonDirection
Requirement
optional
Prop
showButton
Type
boolean | undefined
Default
messageScrollerDefaults.showButton
Requirement
optional
Prop
buttonLabel
Type
string | undefined
Default
Requirement
optional
Prop
label
Type
string | undefined
Default
messageScrollerDefaults.label
Requirement
optional
Prop
busy
Type
boolean | undefined
Default
false
Requirement
optional
Prop
className
Type
string | undefined
Default
Requirement
optional

Content regions

  • default

Import

import { Component } from "@angular/core";
import { GrassrootMessageScroller } from "@grassroot/ui-angular/message-scroller";

Props

Prop
Type
Default
Requirement
messages
readonly MessageScrollerMessage[]
[]
optional
autoScroll
boolean
messageScrollerDefaults.autoScroll
optional
defaultScrollPosition
MessageScrollerDefaultScrollPosition
messageScrollerDefaults.defaultScrollPosition
optional
preserveScrollOnPrepend
boolean
messageScrollerDefaults.preserveScrollOnPrepend
optional
scrollEdgeThreshold
number
messageScrollerDefaults.scrollEdgeThreshold
optional
scrollMargin
number
messageScrollerDefaults.scrollMargin
optional
scrollPreviousItemPeek
number
messageScrollerDefaults.scrollPreviousItemPeek
optional
buttonDirection
MessageScrollerDirection
messageScrollerDefaults.buttonDirection
optional
showButton
boolean
messageScrollerDefaults.showButton
optional
buttonLabel
string
optional
label
string
messageScrollerDefaults.label
optional
busy
boolean
false
optional
className
string
optional
Prop
messages
Type
readonly MessageScrollerMessage[]
Default
[]
Requirement
optional
Prop
autoScroll
Type
boolean
Default
messageScrollerDefaults.autoScroll
Requirement
optional
Prop
defaultScrollPosition
Type
MessageScrollerDefaultScrollPosition
Default
messageScrollerDefaults.defaultScrollPosition
Requirement
optional
Prop
preserveScrollOnPrepend
Type
boolean
Default
messageScrollerDefaults.preserveScrollOnPrepend
Requirement
optional
Prop
scrollEdgeThreshold
Type
number
Default
messageScrollerDefaults.scrollEdgeThreshold
Requirement
optional
Prop
scrollMargin
Type
number
Default
messageScrollerDefaults.scrollMargin
Requirement
optional
Prop
scrollPreviousItemPeek
Type
number
Default
messageScrollerDefaults.scrollPreviousItemPeek
Requirement
optional
Prop
buttonDirection
Type
MessageScrollerDirection
Default
messageScrollerDefaults.buttonDirection
Requirement
optional
Prop
showButton
Type
boolean
Default
messageScrollerDefaults.showButton
Requirement
optional
Prop
buttonLabel
Type
string
Default
Requirement
optional
Prop
label
Type
string
Default
messageScrollerDefaults.label
Requirement
optional
Prop
busy
Type
boolean
Default
false
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional

Content regions

  • default

Import

import { MessageScroller } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
messages
readonly MessageScrollerMessage[]
optional
autoScroll
boolean
optional
defaultScrollPosition
MessageScrollerDefaultScrollPosition
optional
preserveScrollOnPrepend
boolean
optional
scrollEdgeThreshold
number
optional
scrollMargin
number
optional
scrollPreviousItemPeek
number
optional
buttonDirection
MessageScrollerDirection
optional
showButton
boolean
optional
buttonLabel
string
optional
label
string
optional
busy
boolean
false
optional
className
string
optional
Prop
messages
Type
readonly MessageScrollerMessage[]
Default
Requirement
optional
Prop
autoScroll
Type
boolean
Default
Requirement
optional
Prop
defaultScrollPosition
Type
MessageScrollerDefaultScrollPosition
Default
Requirement
optional
Prop
preserveScrollOnPrepend
Type
boolean
Default
Requirement
optional
Prop
scrollEdgeThreshold
Type
number
Default
Requirement
optional
Prop
scrollMargin
Type
number
Default
Requirement
optional
Prop
scrollPreviousItemPeek
Type
number
Default
Requirement
optional
Prop
buttonDirection
Type
MessageScrollerDirection
Default
Requirement
optional
Prop
showButton
Type
boolean
Default
Requirement
optional
Prop
buttonLabel
Type
string
Default
Requirement
optional
Prop
label
Type
string
Default
Requirement
optional
Prop
busy
Type
boolean
Default
false
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional

Content regions

  • children

Import

import { MessageScroller } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
messages
readonly MessageScrollerMessage[]
optional
autoScroll
boolean
optional
defaultScrollPosition
MessageScrollerDefaultScrollPosition
optional
preserveScrollOnPrepend
boolean
optional
scrollEdgeThreshold
number
optional
scrollMargin
number
optional
scrollPreviousItemPeek
number
optional
buttonDirection
MessageScrollerDirection
optional
showButton
boolean
optional
buttonLabel
string
optional
label
string
optional
busy
boolean
optional
className
string
optional
ref
(handle: MessageScrollerHandle | undefined) => void
optional
Prop
messages
Type
readonly MessageScrollerMessage[]
Default
Requirement
optional
Prop
autoScroll
Type
boolean
Default
Requirement
optional
Prop
defaultScrollPosition
Type
MessageScrollerDefaultScrollPosition
Default
Requirement
optional
Prop
preserveScrollOnPrepend
Type
boolean
Default
Requirement
optional
Prop
scrollEdgeThreshold
Type
number
Default
Requirement
optional
Prop
scrollMargin
Type
number
Default
Requirement
optional
Prop
scrollPreviousItemPeek
Type
number
Default
Requirement
optional
Prop
buttonDirection
Type
MessageScrollerDirection
Default
Requirement
optional
Prop
showButton
Type
boolean
Default
Requirement
optional
Prop
buttonLabel
Type
string
Default
Requirement
optional
Prop
label
Type
string
Default
Requirement
optional
Prop
busy
Type
boolean
Default
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional
Prop
ref
Type
(handle: MessageScrollerHandle | undefined) => void
Default
Requirement
optional

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.