grasscnGitHub

Message

Original Minecraft chat foreground rows with accessible content.

Preview

<Steve> The bridge is finished.
Changes saved.
Loading example...
To run this copied example, install these items using the linked CLI or manual instructions:

Usage

Place MessageContent inside Message. Scalar content automatically prefixes the supplied author, so pass only the message body. kind="system" uses yellow system text; align supports start/end.

Composition

MessageGroup groups rows but does not supply scale context. Set scale on each Message or inherit it from MessageScroller. MessageAvatar, Header and Footer support additional arrangements; rich children are preserved rather than treated as a plain chat string.

Interaction and limits

Keep stable message identifiers in a scrolling conversation and choose live-region behavior for your application. Captured coverage concerns fixed chat foreground rows, colors, widths and glyph sets; avatar arrangements, reactions, fading and arbitrary rich content are outside that native scope.

See Bubble for conversation composition and Message Scroller for bounded history and follow-latest behavior.

Installation

Loading registry address

Component source

This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.

Component implementationcomponents/ui/message.tsx · tsx
"use client";

import * as React from "react";

import "./minecraft-message.css";
import { MinecraftChatText } from "./minecraft-chat-text";
import {
  isMinecraftEmptyChild,
  isMinecraftTextContent,
  minecraftClasses as cn,
  minecraftStyle,
} from "./minecraft-render";

Interactive playground

<Steve> The dashboard is ready for review.
<Alex> 带上你的镐子。
<Steve> I added the revenue breakdown.
<Alex> 找到钻石了!
<You> I will check the mobile layout.
Changes saved.
<Steve> The sun is setting.
<Alex> 回家吧。
<You> The bridge is finished.
<Steve> Looks great!
<Alex> 明天继续。
Changes saved.
12 messages