Follow-latest and manual-reading behavior for Minecraft messages.
Preview
Usage
Install message, then import the scroller parts from components/ui/message-scroller. MessageScrollerProvider must wrap every hook consumer; the visual Root alone does not provide that hook boundary. Give the viewport an explicit bounded height.
Composition
Compose Root, Viewport, Content and Item with stable messageId values. Root propagates MessageScale. The example uses Provider autoScroll/defaultScrollPosition end and useMessageScroller().scrollToStart({behavior:"instant"}); the Latest button scrolls back to the end.
Interaction and limits
Content role log and aria-live polite are choices made by this example, not automatic semantics. Follow-latest respects manual reading through the @shadcn/react engine. Scrolling controls and conversation layout are web adaptations; this is part of the message install identity.
See the upstream API for the underlying part and event contracts.
Installation
The message composer in this example also uses Input. Install input alongside message when copying it; Message already includes its Button implementation.
This page shares the message installation identity; choose its own implementation file below. There is no separate registry item for this part.
Component source
This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.
"use client";
import { MessageScroller as Primitive } from "@shadcn/react/message-scroller";
import "./minecraft-message-scroller.css";
import * as React from "react";
import { Button } from "./button";
import { MessageContent, MessageScale } from "./message";
import {
isMinecraftTextContent,
minecraftClasses as cn,