Skip to content

Rich Text

ztui Rich Text showing bold, colored, and aligned inline markup

<RichText> renders text with inline markup so you can mix styles within one run without nesting widgets: [bold]…[/], [color]…[/], links, and more.

import { RichText } from "@huyz0/ztui/react";
<RichText>[bold]Status:[/] [green]ok[/] · latency [cyan]142ms[/]</RichText>
<RichText style={{ align: "center", color: "$primary", bold: true }}>
Centered heading
</RichText>;
  • The content is the child string; markup tags are parsed inline.
  • The element’s style applies as the base; inline tags layer on top.
  • For whole documents (headings, lists, code), use Markdown instead.

Full demo →