tui-prompts
is a Rust crate that provides prompt widgets for the Ratatui crate. It allows for easy
creation of interactive command-line interfaces with various types of prompts. Inspired by
https://www.npmjs.com/package/prompts and various other prompt libraries.
Add the following to your Cargo.toml
file:
toml
[dependencies]
ratatui = "0.21.0"
tui-prompts = "0.1.0"
Very much a work in progress
```rust struct App<'a> { username: TextState<'a>, password: TextState<'a>, }
impl<'a> App<'a> {
fn draw_ui
let area = Rect::new(0, 1, frame.size().width, 1);
TextPrompt::from("Password")
.with_render_style(TextRenderStyle::Password)
.draw(frame, area, &mut self.password);
}
} ```
Dual-licensed under Apache 2.0 or MIT.