Skip to content

Render text as brick art with Unicode box-drawing characters — CLI and TUI

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

mingjerli/brick-text-builder-tui

Repository files navigation

Brick Text Builder TUI

Crates.io License

A Rust application that renders text as ASCII art using brick-like blocks with Unicode box-drawing characters. Supports an interactive TUI mode and CLI rendering with letter-by-letter animation.

Demo

CLI Mode — Build Animation

CLI build demo

CLI Mode — Marquee

CLI marquee demo

TUI Mode

TUI demo

Installation

From crates.io

cargo install brick-text-builder-tui

From GitHub Releases

Download a prebuilt binary from the Releases page for Linux (x86_64, ARM64) and macOS (Intel, Apple Silicon).

From source

git clone https://github.com/mingjerli/brick-text-builder-tui.git
cd brick-text-builder-tui
cargo build --release

The compiled binary is named bricktext.

Local install

To build and install from a local checkout:

cargo install --path .

This compiles in release mode and places the bricktext binary in your Cargo bin directory (typically ~/.cargo/bin).

Usage

TUI Mode (Interactive)

Launch the interactive terminal UI with no arguments:

bricktext

TUI Controls:

Key Action
i Enter text input mode
b Build text
c Cycle color modes
s Cycle brick sizes
x Toggle chaotic mode
n Toggle instant mode
←/→ Adjust speed
1-6 Select presets
q Quit
Esc Exit input mode

CLI Mode (Animated)

Provide text as an argument:

bricktext "BRICK"
bricktext "BRICK" --speed 50
bricktext "BRICK" --color blue --instant

By default, bricks are built letter by letter — each character's bricks drop with gravity and settle before the next character begins. When the text is wider than the terminal, a marquee-style loop scrolls the text continuously: after the last character finishes, the viewport keeps advancing and new characters wrap in from the right, creating a seamless infinite scroll effect. When the text fits within the terminal, the animation stops after the last character.

Use --instant for a character-by-character reveal without brick-drop physics — each character appears fully formed one at a time. The same marquee/stopping behavior applies: long text loops as a marquee, short text stops.

Press q, Esc, or Ctrl+C to quit the animation at any time.

Auto-scaling

CLI and animated modes always render at the default scale (7×4), matching TUI mode exactly. If the terminal is too short for the 49-row output, the scale factors are reduced (5×3, 3×2, or 1×1) to fit, preserving visual aspect ratio — but the output never scales up beyond 7×4. These modes render through ratatui's inline viewport (Viewport::Inline), which reserves the required rows in the current terminal, renders with automatic diffing, and leaves the last frame visible on exit. No alternate screen is used. TUI mode is unaffected.

CLI Flags

Flag Default Description
--tui false Explicitly launch TUI mode
-c, --color random Color mode: rainbow, red, blue, green, yellow, orange, purple, cyan, white, random, spring, summer, fall, winter
--size all Brick size: all (widths 1-4) or small (widths 1-2)
--chaotic false Randomize brick placement patterns
--instant false Show characters one at a time without brick-drop physics
--speed 80 Animation speed (1-100, higher = faster)

Supported Characters

A-Z, 0-9, space, , (comma), and . (period). Lowercase input is automatically converted to uppercase.

Examples

# Animated with rainbow colors
bricktext "BRICK" --color rainbow --speed 75

# Seasonal colors with animation
bricktext "BRICK" --color spring --speed 50

# Small chaotic bricks
bricktext "BRICK" --size small --chaotic

Running Tests

cargo test

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

About

Render text as brick art with Unicode box-drawing characters — CLI and TUI

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published