Component

RunLengthPack

One activation performs a real run-length encoding of the supplied label. Consecutive equal characters become visible tokens such as `a×3`, while the original sequence remains restorable with the same control.

Possible use

It could let a reviewer compress an emphatic handoff label before storing it in a tiny display, or let a presenter turn a repeated phrase into a small encoding artifact.

Reasonable alternative

A reasonable local alternative is a short run-length utility used where storage actually matters, while leaving the readable text alone. A visible packer optimizes a sentence nobody asked to compress.

01 / Preview

Try it yourself.

Preview Interactive
Run-length packOriginal sequence

Sooo much ceremony

Repeated neighbors are waiting to be compressed.
18 glyphs in the intake.
Mechanism
1
Start with a label containing adjacent repetitions.
2
Pack the runs; each repeated glyph becomes a counted token.
3
Unpack the sequence to restore the exact readable text.

02 / Usage

Put it somewhere.

example.tsxTSX
import { RunLengthPack } from "gra-ui";
import "gra-ui/styles.css";

export function PackedNotice() {
  return <RunLengthPack label="Sooo much ceremony" />;
}

03 / API

Small surface area.

PropTypeDescription
labelstringThe text whose adjacent repeated characters are packed into counted runs.