Skip to content
All components
Conversation

Message scroller

Scroll a growing conversation so it follows new and streamed content only while the reader is at the end, and gives an explicit way back to the latest message after they scroll up.

A log that follows new content only while you are already at the end.

Installation

tdpxl is not an npm dependency of your app. The @tdpxl/cli command (not published to npm yet) copies the source into your project, with the registry items and npm packages it imports.

npx @tdpxl/cli add message-scroller

Then import it from @/components/ui/message-scroller. New project? Start with the installation guide.

Examples

Each example is one branch of the official demo, rendered in its own frame. The code is that branch as you would write it, with imports pointing at the default install paths.

Streaming with status

Stream a reply without announcing every word. The scroller follows growth while the reader is at the end, and a single status message announces when the reply is complete. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { Button } from "@/components/ui/button"
import { Bubble, BubbleContent } from "@/components/ui/bubble"

import {
  Message,
  MessageContent,
  MessageGroup,
} from "@/components/ui/message"
import {
  MessageScroller,
  MessageScrollerButton,
  MessageScrollerContent,
  MessageScrollerViewport,
} from "@/components/ui/message-scroller"

const history = [
  { author: "Support", text: "Hi! How can we help with your order today?" },
  { author: "You", text: "My package shows delivered but it is not here." },
  { author: "Support", text: "Sorry about that. Could you check with your neighbours or building reception first?" },
  { author: "You", text: "I did, nobody has it." },
]

const reply =
  "Thanks for checking. I have opened a delivery investigation. You will get an update by email within two business days, and if the package is not found we will send a replacement at no cost."

function StreamingReply() {
  const [streamed, setStreamed] = React.useState<string | null>(null)
  const [status, setStatus] = React.useState("")
  const words = reply.split(" ")
  const streaming = streamed !== null && streamed !== reply

  React.useEffect(() => {
    if (!streaming) return
    const timer = window.setTimeout(() => {
      const next = words.slice(0, (streamed?.split(" ").filter(Boolean).length ?? 0) + 2).join(" ")
      setStreamed(next)
      if (next === reply) setStatus("Support replied.")
    }, 120)
    return () => window.clearTimeout(timer)
  }, [streamed, streaming, words])

  return (
    <div className="flex h-80 w-full max-w-md flex-col overflow-hidden rounded-16 border border-soft-200 bg-white-0">
      <MessageScroller>
        <MessageScrollerViewport role="region" aria-label="Support conversation">
          <MessageScrollerContent>
            <MessageGroup>
              {history.map((message, index) => (
                <Message key={index} align={message.author === "You" ? "end" : "start"}>
                  <MessageContent>
                    <Bubble
                      variant={message.author === "You" ? "primary" : "muted"}
                      align={message.author === "You" ? "end" : "start"}
                    >
                      <BubbleContent>
                        <span className="sr-only">{message.author}: </span>
                        {message.text}
                      </BubbleContent>
                    </Bubble>
                  </MessageContent>
                </Message>
              ))}
              {streamed !== null && (
                <Message aria-busy={streaming || undefined}>
                  <MessageContent>
                    <Bubble variant="muted">
                      <BubbleContent>
                        <span className="sr-only">Support: </span>
                        {streamed || "…"}
                      </BubbleContent>
                    </Bubble>
                  </MessageContent>
                </Message>
              )}
            </MessageGroup>
          </MessageScrollerContent>
        </MessageScrollerViewport>
        <MessageScrollerButton />
      </MessageScroller>
      <p role="status" className="sr-only">
        {status}
      </p>
      <div className="border-t border-soft-200 p-3">
        <Button
          type="button"
          size="xs"
          emphasis="stroke"
          intent="neutral"
          className="w-full"
          loading={streaming}
          onClick={() => {
            setStatus("")
            setStreamed("")
          }}
        >
          Stream the support reply
        </Button>
      </div>
    </div>
  )
}

export function MessageScrollerStreamingWithStatus() {
  return (
    <div className="flex w-full max-w-md flex-col gap-10">
      <StreamingReply />
    </div>
  )
}

Empty conversation

Show an empty conversation with guidance. There is nothing to scroll, so the return action stays hidden. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { MessagesSquareIcon } from "lucide-react"

import {
  Empty,
  EmptyDescription,
  EmptyMedia,
  EmptyTitle,
} from "@/components/ui/empty"

import {
  MessageScroller,
  MessageScrollerButton,
  MessageScrollerContent,
  MessageScrollerViewport,
} from "@/components/ui/message-scroller"

const reply =
  "Thanks for checking. I have opened a delivery investigation. You will get an update by email within two business days, and if the package is not found we will send a replacement at no cost."

export function MessageScrollerEmptyConversation() {
  return (
    <div className="flex w-full max-w-md flex-col gap-10">
      <div className="flex h-64 w-full max-w-md flex-col overflow-hidden rounded-16 border border-soft-200 bg-white-0">
        <MessageScroller>
          <MessageScrollerViewport role="region" aria-label="New conversation">
            <MessageScrollerContent className="h-full justify-center">
              <Empty className="border-0">
                <EmptyMedia>
                  <MessagesSquareIcon aria-hidden="true" />
                </EmptyMedia>
                <EmptyTitle>No messages yet</EmptyTitle>
                <EmptyDescription>
                  Ask a question about your order and a person from support will reply.
                </EmptyDescription>
              </Empty>
            </MessageScrollerContent>
          </MessageScrollerViewport>
          <MessageScrollerButton />
        </MessageScroller>
      </div>
    </div>
  )
}

Narrow log

Expose a compact chat as a named log in a narrow container. role log announces messages added at the end, and bubbles widen to use the small width. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import { Bubble, BubbleContent } from "@/components/ui/bubble"

import {
  Message,
  MessageContent,
  MessageGroup,
} from "@/components/ui/message"
import {
  MessageScroller,
  MessageScrollerButton,
  MessageScrollerContent,
  MessageScrollerViewport,
} from "@/components/ui/message-scroller"

const seed = [
  "What is in the registry?",
  "Fifty-five components, two generated items and a hook.",
  "How are the dependencies declared?",
  "They are not declared. The build reads each file's imports.",
  "What happens when one is missing?",
  "The build fails before anything is published.",
  "Does dark mode need extra classes?",
  "No. A role points at a different ramp step.",
]

export function MessageScrollerNarrowLog() {
  return (
    <div className="flex w-full max-w-md flex-col gap-10">
      <div className="flex h-72 w-full max-w-72 flex-col overflow-hidden rounded-16 border border-soft-200 bg-white-0">
        <MessageScroller>
          <MessageScrollerViewport role="log" aria-label="Team chat">
            <MessageScrollerContent className="gap-4 p-3">
              <MessageGroup className="gap-4">
                {seed.map((line, index) => (
                  <Message key={index} align={index % 2 ? "end" : "start"}>
                    <MessageContent>
                      <Bubble
                        variant={index % 2 ? "primary" : "muted"}
                        align={index % 2 ? "end" : "start"}
                        className="max-w-[90%]"
                      >
                        <BubbleContent>{line}</BubbleContent>
                      </Bubble>
                    </MessageContent>
                  </Message>
                ))}
              </MessageGroup>
            </MessageScrollerContent>
          </MessageScrollerViewport>
          <MessageScrollerButton />
        </MessageScroller>
      </div>
    </div>
  )
}

API reference

Generated from the component's TypeScript signatures. Inherited DOM and primitive props are listed separately.

MessageScroller

A log that follows new content only while the reader is already at the end. Scrolling up is a decision, so a message arriving must not undo it; the button is what brings the reader back.

MessageScroller props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
Inherited props (13)
MessageScroller inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MessageScrollerButton

The MessageScrollerButton part of message-scroller. Use it with the complete source composition and preserve its required parent context.

MessageScrollerButton props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
intent"primary" | "neutral" | "error" | null | undefined—Semantic purpose: primary action, neutral action, or destructive/error action. Independent of visual emphasis. Defaults to primary.
emphasis"link" | "filled" | "stroke" | "lighter" | "ghost" | null | undefined—Visual weight: filled, stroke, lighter, ghost, or link (text only, underlined on hover). Does not change the action's semantics; use asChild with an anchor when it navigates. Defaults to filled.
size"xs" | "sm" | "md" | "lg" | null | undefined—Control size: xs, sm, md, or lg. Keep labels and icons readable when choosing a size. Defaults to md.
asChildboolean | undefined—Merge styles and behavior into one child element instead of rendering a button. Use a real anchor with href for navigation; native disabled does not disable an anchor. Defaults to false.
iconOnlyboolean | undefined—Square button for a single icon at the selected size. Always provide aria-label (or aria-labelledby) because there is no visible text. Defaults to false.
loadingboolean | undefined—Show a spinner while an operation runs. The button keeps its width and focus, exposes aria-busy and aria-disabled, and ignores activation until loading ends; with asChild the spinner renders inside the child and its onClick and navigation are blocked. Defaults to false.
Inherited props (18)
MessageScrollerButton inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLButtonElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
disabledboolean | undefined—Make the supported control unavailable through its native or primitive disabled semantics. This does not disable arbitrary child links.
formstring | undefined—ID of the form associated with this control, including when it is rendered outside that form element.
namestring | undefined—Name used by the control's form submission or primitive form integration.
type"button" | "submit" | "reset" | undefined—Native element or primitive mode defined by the source union. Choose a supported value; its meaning depends on the component.
valuestring | number | readonly string[] | undefined—Current value in the shape defined by the source type. For controlled interactive inputs, apply updates from the change callback.
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLButtonElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLButtonElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLButtonElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLButtonElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLButtonElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLButtonElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MessageScrollerContent

Content region within the root composition. Keep required providers, labels and related controls from the complete example.

MessageScrollerContent props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
Inherited props (13)
MessageScrollerContent inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MessageScrollerItem

One item within its parent composition. Keep parent context and the value, label or state required by the source API.

MessageScrollerItem props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
scrollAnchorboolean | undefinedfalseExpose a data-scroll-anchor marker on this item. It does not independently scroll the viewport.
Inherited props (13)
MessageScrollerItem inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

MessageScrollerViewport

Viewport for the parent composition. Preserve its scrolling, focus and sizing responsibilities.

MessageScrollerViewport props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
childrenReact.ReactNode—Represents all of the things React can render.
Inherited props (13)
MessageScrollerViewport inherited props
PropTypeDefaultDescription
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

Accessibility & usage

From registry/ui/message-scroller.meta.json (authored guidance; human review may still be pending). Behavior is checked by Storybook tests, not certified here.

When to use

  • Chat and assistant conversations where messages are appended or streamed at the bottom.
  • Live logs or activity feeds that grow at the end and should not pull a reader away from what they are reading.
  • Any bounded panel where newest content is at the bottom and people sometimes read older content.

When not to use

  • Static content in a bounded region; use a scroll area.
  • Feeds where new items are added at the top, or infinite lists loading older content at the end; the follow logic assumes growth at the bottom.
  • The main page scroll; the scroller needs a bounded height from its parent.

Anatomy

MessageScroller
Context root that tracks whether the reader is at the end (data-at-end) and exposes scrollToEnd; must sit in a parent with a bounded height.
MessageScrollerViewport
The focusable native scroll container (tabIndex 0). Observes content size and follows growth only while at the end (24 px threshold); forwards onScroll.
MessageScrollerContent
Padded column for messages and markers.
MessageScrollerItem
Optional wrapper per entry; scrollAnchor only adds a data-scroll-anchor marker and does not scroll by itself.
MessageScrollerButton
Return action named 'Scroll to the latest message', shown only when the reader is away from the end; moves focus to the viewport before it disappears.
useMessageScroller
Hook for custom controls: atEnd, setAtEnd, scrollToEnd and the viewport ref.

Keyboard & interaction

  • At the end, new or streamed content keeps the view pinned to the bottom; scrolling up (wheel, touch, keyboard) stops following until the reader returns within 24 px of the end.
  • The viewport is focusable, so keyboard users scroll with arrows, Page Up/Down, Home and End; Tab leaves the region.
  • Activating the return button scrolls to the end and, if the button had focus, moves focus to the viewport so focus is not lost when the button hides.
  • scrollToEnd honors prefers-reduced-motion at call time: instant when reduced, smooth otherwise.
  • Announcements are the consumer's choice: role="log" on the viewport for discrete messages, or one status message when a streamed reply completes (WCAG 4.1.3).

Responsive behavior

  • Give the scroller a height from its layout (flex child of a full-height chat panel, or an explicit height) so it scrolls on every screen size.
  • On mobile, keep the composer outside the viewport so it stays visible when the on-screen keyboard opens; the viewport shrinks instead.
  • The return button is centered at the bottom; keep it clear of the composer and at least 24x24 CSS pixels (32 by default).
  • Allow bubbles to use more width in narrow panels; long words already wrap.

Content guidelines

  • For an empty conversation, show what the person can ask and who will answer instead of an empty box.
  • Name the conversation region ('Support conversation') when it has a role, so screen readers announce what they entered.
  • When streaming, show a visible typing or busy cue and announce once when the reply is complete ('Support replied').
  • Use markers for dates and unread boundaries so people can orient after scrolling.

Alternatives

  • Scroll area — A bounded region with styled scrollbars and no follow behavior.
  • Message — The turn layout rendered inside the scroller.

Resources