2 releases
new 0.1.1 | Feb 28, 2025 |
---|---|
0.1.0 | Feb 28, 2025 |
#203 in Command-line interface
93KB
1K
SLoC
tui-gradient-block
an extension to ratatui's block widget with support for border gradients and a lot of different things that the ordinary block doesn't have, allowing for very visually appealing tuis.
Note:
this crate is in the experimental versions and some things may not work as expected
Features
- customizable gradients that can be applied to
- fill text
- borders
- titles
- fully customizable borders
- fill text
- pre-defined border styles
Planned features
- margin
- pre-defined gradient themes
fn render_gradient_block() {
let gradblock = tui_gradientblock::new(&frame.area(), SplitBorderSegments::NONE)
.set_gradients(vec![
(
GradientSegments::Right,
vec![(251, 8, 255), (10, 100, 112)],
1.0,
),
(
GradientSegments::Top,
vec![(10, 100, 112), (251, 8, 255)],
1.0,
),
(
GradientSegments::Left,
vec![(10, 100, 112), (10, 100, 112)],
1.0,
),
(
GradientSegments::Bottom,
vec![(10, 100, 112), (10, 100, 112)],
1.0,
),
])
.top_titles(vec![(
"Top title".to_owned(),
TitleAlignment::Centered,
Some((vec![(14, 67, 240), (90, 34, 128)], 1.0)),
)])
.set_lines();
frame.render_widget(gradblock, frame.area());
}
with multiple titles and border gradients
multiple pre-defined misc types
this crate was made by an intermediate frontend web developer and a beginner to rust who started learning about 4 months ago.
please give me recommendations on pre-defined border themes as your input would be very helpful.
Dependencies
~7–16MB
~216K SLoC