Extra widgets for Ratatui
APACHE-2.0 License
Please note: this crate is deprecated so that we can use the name for an internal Ratatui widget crate. Please use tui-framework-experiment instead.
ratatui-widgets
is a Rust crate with extra widgets for Ratatui.
cargo add ratatui-widgets
// TODO: Add usage examples
This README sets up an initial goal for a library of widgets to supplement Ratatui. This library will release breaking changes regularly - move fast and break things. A focus on fast delivery rather than gating on perfection is key here. Expect to see releases anytime a feature is changed or added. Release-plz will keep the version updated with respect to semver and will update the CHANGELOG with information from every PR.
This is not (yet?) an official Ratatui-org project, but may be at some point in the future.
Basic event handling abstraction and keyboard / mouse handling
Basic buttons
let button = Button::new("Click me");
Stack container that handles widgets and layouts
let stack = StackContainer::horizontal().with_widgets(vec![
(Box::new(Line::raw("Left")), Constraint::Fill(1)),
(Box::new(Text::raw("Center")), Constraint::Fill(1)),
(Box::new(Span::raw("Right")), Constraint::Fill(1)),
]);
Most of this list of widgets from https://en.wikipedia.org/wiki/Graphical_widget#List_of_common_generic_widgets
[Submit]
(*) item ( ) item
[x] item
<_ON_ / OFF >
[ON]
[Submit][↓]
[Red]
=> [Green]
=> [Blue]
[------------|---------------]
[123][+][-]
[Selected Item][↓]
[____________][↓]
<go here>
(integrate with OSC 8)Copyright (c) 2024 Josh McKinney
This project is licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.