rnk-style
Standalone terminal styling library for Rust. Style your terminal output without the full TUI framework.
Inspired by Lip Gloss.
Features
- Chainable API: Fluent style building with
.fg(),.bg(),.bold(), etc. - Color Support: ANSI 16, ANSI 256, and RGB/Hex colors
- Text Formatting: Bold, italic, underline, strikethrough, dim, inverse
- Layout: Padding, margin, borders with multiple styles
- Alignment: Left, center, right text alignment
- Zero Dependencies: Only
unicode-widthfor proper character width handling
Quick Start
use ;
Examples
Basic Styling
use ;
// Simple colored text
let error = new.fg.bold;
println!;
// With background
let highlight = new
.fg
.bg;
println!;
Padding and Borders
use ;
let box_style = new
.padding
.border
.border_fg;
println!;
Preset Styles
use Style;
println!;
println!;
println!;
println!;
Hex Colors
use ;
let style = new
.fg
.bg;
println!;
License
MIT