mirror of
https://github.com/ratatui-org/ratatui
synced 2025-02-16 14:08:44 +00:00
`ratatui::widgets::block::Title` is deprecated in favor of using `Line` to represent titles. This removes an unnecessary layer of wrapping (string -> Span -> Line -> Title). This struct will be removed in a future release of Ratatui (likely 0.31). For more information see: <https://github.com/ratatui/ratatui/issues/738> To update your code: ```rust Block::new().title(Title::from("foo")); // becomes any of Block::new().title("foo"); Block::new().title(Line::from("foo")); Block::new().title(Title::from("foo").position(Position::TOP)); // becomes any of Block::new().title_top("foo"); Block::new().title_top(Line::from("foo")); Block::new().title(Title::from("foo").position(Position::BOTTOM)); // becomes any of Block::new().title_bottom("foo"); Block::new().title_bottom(Line::from("foo")); ``` |
||
---|---|---|
.. | ||
main | ||
main.rs |