scrin
Made by KnottDynamics.
scrin is a Rust terminal UI toolkit for building polished command-line
interfaces without Ratatui. It provides Scrin-native buffers, colors, layout,
styled text, widgets, panes, overlays, command palettes, status bars, input
routing, terminal lifecycle helpers, and animation utilities.
Scrin also ships with Aisling-powered effects and loaders. The aisling crate
is baked in as a first-class dependency, and Scrin adapts Aisling frames into
Scrin buffers so animated text effects and progress loaders can live beside
normal widgets.
Install
[]
= "0.1.75"
Why Scrin
- Scrin-native terminal rendering with no Ratatui dependency.
- Composable widgets for blocks, paragraphs, lists, tables, tabs, charts, gauges, markdown output, forms, popups, toggles, and more.
- App structure primitives for panes, overlays, modals, toasts, status bars, command palettes, event routing, scrolling, and text expansion.
- Rich terminal text with spans, lines, wrapping, scrolling, alignment, colors, and modifiers.
- Aisling integration for cinematic effects and loaders rendered directly into Scrin buffers.
- Demos and scripts that exercise widgets, overlays, Aisling effects, loaders, and a full Scrin shell showcase.
Draw A Widget
use Buffer;
use Color;
use Rect;
use ;
use Paragraph;
use Widget;
let mut buffer = new;
buffer.fill;
let block = new.with_borders;
block.render;
let text = new;
text.render;
Use The Terminal API
Terminal::draw builds a frame, renders into Scrin's back buffer, and presents a
diff to the terminal. The diff presenter repositions for separated dirty runs on
the same row and handles wide-glyph continuation cells.
use ;
use ;
use Widget;
let mut terminal = init_with?;
terminal.draw?;
terminal.restore?;
# Ok::
For dense animation or integrations that prefer repainting every cell,
Terminal::draw_full and Terminal::present_full are available.
Aisling Effects
Scrin exposes Aisling through scrin::effects. You can select an Aisling
EffectKind, tune the effect with Scrin colors and sizing, and render the
current Aisling frame into any Scrin Buffer area.
use Buffer;
use Color;
use Rect;
use ;
let mut buffer = new;
let mut effect = new
.with_size
.with_duration
.with_seed
.with_accent;
effect.render_to_buffer;
effect.advance;
Useful effect APIs:
EffectPlayer::new(kind, text)creates an Aisling-backed text effect.EffectPlayer::with_config(kind, text, config)accepts an AislingEffectConfigre-exported fromscrin::effects.with_size,with_duration,with_seed,with_accent, andwith_gradient_colorstune how the effect is generated and mapped.render_to_bufferandrender_frame_to_buffercopy Aisling frame cells into a Scrin buffer region.get_ansi_stringreturns Aisling's raw ANSI frame when you want standalone effect output.EffectPlayer::all_kinds()returns everyEffectKindavailable in the baked Aisling version.
Aisling Loaders
Loaders are also Aisling-backed. Scrin maps loader frames into buffers and keeps
progress helpers on LoaderPlayer.
use Buffer;
use Color;
use Rect;
use ;
let mut buffer = new;
let loader = new
.with_size
.with_label
.with_unit
.with_fraction
.with_accent;
let progress = progress_from_counts;
loader.render;
Useful loader APIs:
LoaderPlayer::new(kind)creates an Aisling-backed loader.LoaderPlayer::with_config(kind, config)accepts an AislingLoaderConfigre-exported fromscrin::effects.with_size,with_label,with_unit,with_fraction,with_accent, andwith_gradient_colorstune the loader presentation.render(tick, progress, buffer, area)draws the current loader frame into a Scrin buffer.get_ansi_string(tick, progress)returns the raw ANSI loader frame.progress_from_countsandprogress_from_fractioncreate Aisling progress values without importing Aisling directly.LoaderPlayer::all_kinds()returns everyLoaderKindavailable in the baked Aisling version.
Modules
scrin::core:Buffer,Cell,Color,Gradient, andRect.scrin::layout: horizontal and vertical layout constraints.scrin::widgets: blocks, paragraphs, rich text, lists, tables, forms, charts, gauges, markdown output, popups, toggles, scrollbars, and clearing helpers.scrin::terminal: raw-mode setup, frame drawing, diff/full presenters, cursor control, mouse capture, bracketed paste, and restore-once lifecycle.scrin::effects: Aisling-backedEffectPlayer,LoaderPlayer, effect kinds, loader kinds, progress, and config types.scrin::panes,scrin::overlays,scrin::command_palette,scrin::status_bar, andscrin::input: higher-level application structure.scrin::sanitize: display-width-safe terminal string helpers.
Demos
Run demos with the scripts in scripts/:
The Aisling story demo is the broadest visual smoke test: it walks the available effect inventory and rotates through loader systems using the Aisling bridge.
Publishing Notes
The crate is intended to publish cleanly to crates.io and build on docs.rs. The
package excludes generated target/** artifacts and includes source, examples,
tests, scripts, and this README.
Recommended pre-publish checks: