scrin 0.1.75

A terminal UI toolkit with panes, widgets, overlays, animations, and Aisling-powered effects/loaders.
Documentation
//! Scrin is a Rust terminal UI toolkit for building polished command-line
//! interfaces without depending on Ratatui.
//!
//! It provides a Scrin-native rendering model with buffers, colors, rectangles,
//! layout constraints, styled text, widgets, panes, overlays, command palettes,
//! status bars, input routing, terminal lifecycle helpers, and animation glue.
//! The effects layer is powered by [`aisling`](https://crates.io/crates/aisling)
//! and adapts Aisling frames into Scrin buffers, so loaders and text effects can
//! be composed with normal Scrin widgets.
//!
//! # Install
//!
//! ```toml
//! [dependencies]
//! scrin = "0.1.75"
//! ```
//!
//! # Draw A Widget
//!
//! ```rust
//! use scrin::core::buffer::Buffer;
//! use scrin::core::color::Color;
//! use scrin::core::rect::Rect;
//! use scrin::widgets::block::{Block, BorderStyle};
//! use scrin::widgets::Widget;
//!
//! let mut buffer = Buffer::new(40, 8);
//! buffer.fill(Rect::new(0, 0, 40, 8), ' ', Color::WHITE, None);
//!
//! let block = Block::new("scrin").with_borders(BorderStyle::Rounded);
//! block.render(&mut buffer, Rect::new(0, 0, 40, 8));
//! ```
//!
//! # Render An Aisling Effect Into A Scrin Buffer
//!
//! ```rust
//! use scrin::core::{buffer::Buffer, rect::Rect};
//! use scrin::effects::{EffectKind, EffectPlayer};
//!
//! let mut buffer = Buffer::new(60, 6);
//! let mut effect = EffectPlayer::new(EffectKind::Matrix, "Scrin + Aisling")
//!     .with_size(60, 6)
//!     .with_duration(24);
//!
//! effect.render_to_buffer(&mut buffer, Rect::new(0, 0, 60, 6));
//! effect.advance();
//! ```
//!
//! # Render An Aisling Loader
//!
//! ```rust
//! use scrin::core::{buffer::Buffer, rect::Rect};
//! use scrin::effects::{LoaderKind, LoaderPlayer};
//!
//! let mut buffer = Buffer::new(48, 4);
//! let loader = LoaderPlayer::new(LoaderKind::Bar)
//!     .with_size(48, 4)
//!     .with_label("indexing".to_string());
//! let progress = LoaderPlayer::progress_from_fraction(0.42);
//!
//! loader.render(3, progress, &mut buffer, Rect::new(0, 0, 48, 4));
//! ```
//!
//! # Terminal Rendering
//!
//! [`Terminal::draw`] uses Scrin's diff presenter and updates only changed
//! cells. [`Terminal::draw_full`] is available when an application wants a full
//! buffer repaint every frame, for example during dense animation.
//!
//! # Re-Exports
//!
//! Common Aisling selector/config types are re-exported from [`effects`] so a
//! Scrin application can choose effects and loaders through one crate path.
//!
pub mod animation;
pub mod command_palette;
pub mod core;
pub mod effects;
pub mod flow_manager;
pub mod input;
pub mod layout;
pub mod overlays;
pub mod panes;
pub mod sanitize;
pub mod scroll_state;
pub mod status_bar;
pub mod style;
pub mod terminal;
pub mod text_expander;
pub mod theme;
pub mod widgets;

pub use animation::Timeline;
pub use command_palette::CommandPalette;
pub use core::buffer::Buffer;
pub use core::color::Color;
pub use core::rect::Rect;
pub use effects::EffectPlayer;
pub use flow_manager::FlowManager;
pub use input::EventRouter;
pub use layout::Layout;
pub use overlays::{Modal, Toast};
pub use panes::{Pane, PaneManager};
pub use scroll_state::{ScrollState, StickyScroll};
pub use status_bar::StatusBar;
pub use style::Style;
pub use terminal::{Frame, Terminal, TerminalOptions};
pub use text_expander::TextExpander;
pub use theme::Theme;