Crate osui

Source
Expand description

OSUI โ€“ A Rust Terminal User Interface Library

OSUI is a library for building interactive and customizable terminal user interfaces in Rust. It provides a component system, real-time keyboard input handling, and a rsx! macro for defining UI elements in a declarative way, however that is optional.

โœ… Features

  • ๐Ÿงฑ RSX-like syntax with rsx! macro
  • ๐Ÿ–ฅ๏ธ Virtual screen abstraction
  • ๐ŸŽน Keyboard input handling
  • ๐ŸŽฏ Component-based design
  • โšก Real-time rendering

๐Ÿš€ Quick Example

use osui::prelude::*;

fn main() -> std::io::Result<()> {
    let screen = Screen::new();
    rsx! {
        "๐Ÿ‘‹ Hello, World!"
    }.draw(&screen);
    screen.run()
}

๐Ÿงฐ For full documentation, visit: osui.netlify.app/docs

๐Ÿงช Examples and demos: github.com/osui-rs/osui/demos

Modulesยง

elements
extensions
frontend
The frontend binder for OSUI.
macros
prelude
render_scope
Rendering logic and layout scope management for OSUI.
state
style
Layout and style definitions for OSUI widgets.
utils
The utils module provides utility functions for terminal manipulation and string operations, designed to enhance terminal-based applications.
widget
Core widget infrastructure for OSUI.

Macrosยง

component
Declares a struct that implements the Component trait.
event
Declares a struct that implements the Event trait.
event_handler
Creates an event handler closure that calls a method on self.
rsx
Constructs an Rsx tree using declarative syntax.
rsx_inner
Internal macro used by rsx! to recursively build Rsx trees.
transform
Creates a Transform with property overrides.

Structsยง

NoRender
NoRenderRoot
RenderWrapperEvent
Screen
The main screen abstraction for rendering and managing widgets and extensions.