For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. The asciicn agent skill, for building any ASCII effect on the engine, is at /.well-known/agent-skills/asciicn/SKILL.md.

ASCII badge

A status badge set in glyphs, such as [ OK ], < beta > or ┤ v2 ├, with tones from the palette, a fixed width for aligned columns and an optional live dot.

Controls
Shape
Size
Live dot on running
Fixed width

Installation

pnpm dlx shadcn@latest add https://asciicn.dev/r/ascii-badge.json

Usage

import { AsciiBadge } from "@/components/asciicn/ascii-badge";
 
export function BuildStatus() {
  return <AsciiBadge tone="ok">OK</AsciiBadge>;
}

shape sets the glyphs around the label: square ([ OK ]), angle (< beta >), round (( new )), pipe (┤ v2 ├) or inverse, a solid label in reverse video.

tone sets the colour from the --ascii-color-* palette: neutral is ink, ok green, info blue, warn orange, error red and accent purple. Pass color to use any other colour.

By default the label has one cell of space each side. Set width to centre it in at least that many cells instead, so a column of badges lines up: with width={4}, OK and WARN both draw six cells wide, as [ OK ] and [WARN].

dot puts a ● before the label that opens out to ◉ and ◎ and back, for states that are live or running.

Examples

Boot log

Badges at width={6}, so every line of the log starts its text in the same column.

Shapes and labels

Each shape once, then badges next to feature names, one with a live dot.

Props

PropTypeDefault
children

The label. Short text reads best: OK, beta, v2.4.

Type: ReactNodeDefault –
shape

The glyphs around the label, or reverse video.

Type: "square" | "angle" | "round" | "pipe" | "inverse"Default "square"
tone

Sets the colour: ink, green, blue, orange, red or purple.

Type: "neutral" | "ok" | "info" | "warn" | "error" | "accent"Default "neutral"
color

Colour override, a palette name or any CSS colour.

Type: AsciiColorDefault The tone's colour
dot

A pinging ● before the label, for live states.

Type: booleanDefault false
width

Centre the label in at least this many cells, so badges in a column line up.

Type: numberDefault The label plus a cell each side
size

Glyph cell height: 12, 16 or 20px.

Type: "sm" | "md" | "lg"Default "md"
cell

Glyph cell height in CSS pixels. Overrides size.

Type: numberDefault –

Notes

  • The brackets and chevrons are hidden from screen readers, which read the label alone. Write labels that make sense without the colour, such as FAIL rather than a red ●.
  • The badge is a span of DOM text in --ascii-font, so it sits on the text baseline and can be selected and copied.
  • The live dot swaps one glyph six times a second, pauses offscreen and in hidden tabs, and holds a solid ● with reduced motion.