Expand description
§scrin-widgets
scrin-widgets is a plug-and-play Rust widget library for building Scrin-style TUIs with Scrin. It ships animated Aisling effects, ambient glyph fields, glowing gauges, and signal panels that can be dropped into a normal Scrin app.
§Install
From this repo:
[dependencies]
scrin-widgets = { path = "." }Once published to crates.io:
[dependencies]
scrin-widgets = "0.1"§Quick Use
use scrin::{Frame, Rect, widgets::{block::{Block, BorderStyle}, Paragraph, Widget}};
use scrin_widgets::{AislingExt, AislingPalette};
fn draw(frame: &mut Frame<'_>, tick: u64) {
let area = frame.area();
let palette = AislingPalette::dream();
let block = Block::new("Aisling")
.with_borders(BorderStyle::Plain)
.with_border_color(palette.pulse)
.with_inner_margin(Rect::ZERO);
let inner = block.inner(area);
let buffer = frame.buffer();
block.render(buffer, area);
Paragraph::new("any Scrin widget can shimmer")
.aisling()
.tick(tick)
.render(buffer, inner);
}§Included Widgets
Aisling<W> wraps any Scrin Widget and applies animated shimmer, scanline, and edge-glow effects after the widget renders.
GlyphRain renders a deterministic matrix-like field for backgrounds and data streams.
NebulaGauge renders a glowing progress meter with a flowing fill.
SignalPanel renders a compact status panel with animated signal bars.
FlickerPanel renders text with per-character glitch and flicker effects.
Waveform renders an animated oscilloscope display (sine, square, sawtooth, triangle waves).
PulseRing renders expanding concentric rings from the center of an area.
§Examples
Run a static preview:
cargo run --example basicRun the animated showcase:
cargo run --example showcaseRun the animated void orchard:
cargo run --example void_orchardRun the animated starforge panel:
cargo run --example starforgePress q or Esc to exit animated examples.
Re-exports§
pub use scrin;
Modules§
- prelude
- Common imports for apps that want the Scrin widget set plus Scrin.
Structs§
- Aisling
- Wraps any Scrin widget with an Aisling post-render effect.
- Aisling
Effect - A composable post-render effect that can be applied to any Scrin buffer area.
- Aisling
Palette - The default color system used by Aisling effects and bundled widgets.
- Flicker
Panel - A text panel with per-character flicker and glitch effects.
- Glyph
Rain - A deterministic matrix/rain field for ambient Scrin backgrounds.
- Nebula
Gauge - A compact progress gauge with a flowing nebula fill.
- Pulse
Ring - An animated expanding concentric ring effect.
- Signal
Panel - A bordered status panel with animated signal bars.
- Waveform
- An animated oscilloscope / waveform display.
Enums§
Traits§
- Aisling
Ext - Extension trait for calling
.aisling()on any Scrin widget.