## 🤖 New release * `ratatui-widgets`: 0.3.0-beta.0 -> 0.3.0-beta.1 * `ratatui-macros`: 0.7.0-beta.0 -> 0.7.0-beta.1 * `ratatui-termwiz`: 0.1.0-beta.0 -> 0.1.0-beta.1 * `ratatui-termion`: 0.1.0-beta.0 -> 0.1.0-beta.1 * `ratatui`: 0.30.0-beta.0 -> 0.30.0-beta.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `ratatui-widgets` <blockquote> ## [v0.30.0-beta.0](https://github.com/ratatui/ratatui/releases/tag/v0.30.0-beta.0) - 2025-12-23 > _"Rats don't just survive; they discover; they create. ... I mean, just look at what they do with the terminal!" – Remy & Orhun_ We are excited to announce the biggest release of `ratatui` so far - a Rust library that's all about cooking up TUIs 👨🍳🐀 📢 Please note that this is a beta release, and we encourage you to try it out and provide feedback! ✨ **WIP Release highlights**: <https://github.com/ratatui/ratatui-website/blob/ratatui-0.30/src/content/docs/highlights/v0.30.md> ⚠️ List of breaking changes can be found [here](https://github.com/ratatui/ratatui/blob/main/BREAKING-CHANGES.md). ### Features - [90a77aa](90a77aaf8b) *(direction)* Add `Direction::perpendicular(self)` by @b-guild in [#2197](https://github.com/ratatui/ratatui/pull/2197) - [56d5e05](56d5e05762) *(bar)* Update label and text_value to accept Into<> by @Emivvvvv in [#1471](https://github.com/ratatui/ratatui/pull/1471) [**breaking**] > > BREAKING CHANGE:label and text_value now accept `Into<>` types, which > breaks type inference. > > ```diff > - Bar::default().label("foo".into()); > + Bar::default().label("foo"); > ``` > > ```diff > - Bar::default().text_value("bar".into()); > + Bar::default().text_value("bar"); > ``` - [b76ad3b](b76ad3b02e) *(bar)* Impl Styled for Bar by @Emivvvvv in [#1476](https://github.com/ratatui/ratatui/pull/1476) > > Related:https://github.com/ratatui/ratatui/issues/683 - [e15fefa](e15fefa922) *(barchar)* Add BarChart::grouped constructor by @joshka in [#1513](https://github.com/ratatui/ratatui/pull/1513) > Add a new constructor to the `BarChart` widget that allows creating a > grouped barchart with multiple groups of bars. > > Also add a new constructor to the `BarGroup` widget that allows creating > a group of bars with a label. - [369b18e](369b18eef2) *(barchart)* Reduce barchart creation verbosity by @Emivvvvv in [#1453](https://github.com/ratatui/ratatui/pull/1453) > Adds constructor methods for BarChart, BarGroup, and Bar - [1dc18bf](1dc18bf3cf) *(calendar)* Add width and height functions by @joshka in [#2198](https://github.com/ratatui/ratatui/pull/2198) > Fixes https://github.com/ratatui/ratatui/issues/2016 > > --------- - [f18bcbf](f18bcbf06b) *(canvas)* Add quadrant, sextant and octant markers by @sbarral in [#2235](https://github.com/ratatui/ratatui/pull/2235) [**breaking**] > The octant marker is an alternative to the Braille marker with the same > resolution, but offering densely packed, regular pseudo-pixels, without > visible bands between rows and columns. > > Quadrant and Sextants are also added to support 2x2 and 2x3. > > Sextant and Octant unicode characters that are less widely supported at > the moment, which is why `Braille` was left as the default. > > BREAKING CHANGE:addition of new variants to `Marker` and removal of > no longer used constants in `ratatui:🔣:braille`. - [26b05de](26b05dee59) *(chart)* Render Braille over Blocks in Charts and Canvas by @j-g00da in [#2165](https://github.com/ratatui/ratatui/pull/2165) > This makes it possible to stack charts, and write text over block symbols in > Charts and Canvas while still showing the block symbols behind the text. - [bf84c62](bf84c6229b) *(core)* Add a `has_modifier()` method to `Style` by @sxyazi in [#2267](https://github.com/ratatui/ratatui/pull/2267) > Resolves https://github.com/ratatui/ratatui/issues/2264 - [2d713d7](2d713d723d) *(crossterm)* Allow multiple crossterm versions by @joshka in [#1841](https://github.com/ratatui/ratatui/pull/1841) > This commit introduces feature flags to make it possible for widget > library authors to depend on a specific version of crossterm without > causing version conflicts. This should make it easier for libraries and > apps to update crossterm versions more easily. > > The available feature flags are `crossterm_0_28` and `crossterm_0_29`. > By default, the latest version is enabled. If a multiple features are > enabled we choose the latest version. We will in general support at > least the last two major (0.x) versions of crossterm, and will only > remove versions in a major version bump. - [d99984f](d99984f1e9) *(layout)* Add `Flex::SpaceEvenly` by @kdheepak in [#1952](https://github.com/ratatui/ratatui/pull/1952) [**breaking**] > Resolves https://github.com/ratatui/ratatui/issues/1951 > > BREAKING CHANGE:Old `Flex::SpaceAround` behavior is available by using > > `Flex::SpaceEvenly` and new > > `Flex::SpaceAround` now distributes space evenly around each element > except the middle spacers > are twice the size of first and last elements > > With this change, the following variants of `Flex` are supported: > > - `Flex::Start`: Aligns items to the start; excess space appears at the > end. > - `Flex::End`: Aligns items to the end; excess space appears at the > start. > - `Flex::Center`: Centers items with equal space on both sides. > - `Flex::SpaceAround` (**new**): Distributes space _around_ items; space > between items is _twice_ the edge spacing. > - `Flex::SpaceBetween`: Distributes space _evenly between_ items except > no space at the edges. > - `Flex::SpaceEvenly` (**previously `Flex::SpaceAround`**): Distributes > space _evenly between_ items and edges. > - `Flex::Legacy`: Preserves legacy behavior, placing all excess space at > the end. > > This aligns behavior of `Flex` with CSS flexbox more closely. > > The following is a screenshot in action: > > <img width="1090" alt="image" > > src="https://github.com/user-attachments/assets/2c7cd797-27bd-4242-a824-4565d369227b" > /> > > --------- - [9275d34](9275d3421c) *(layout)* Add Offset::new() constructor by @joshka in [#1547](https://github.com/ratatui/ratatui/pull/1547) - [7ad9c29](7ad9c29eac) *(linegauge)* Customized symbols by @sectore in [#1601](https://github.com/ratatui/ratatui/pull/1601) > With this PR any symbol (`&str`) can be used to render `filled` and > `unfilled` parts of `LineGauge` now. Before that change, only > [`symbols::line::Set`](https://docs.rs/ratatui/latest/ratatui/symbols/line/struct.Set.html) > was accepted. > > Note:New methods are introduced to define those symbols: > `filled_symbol` and `unfilled_symbol`. The method > [`line_set`](https://docs.rs/ratatui/latest/ratatui/widgets/struct.LineGauge.html#method.line_set) > is still there, but marked as `deprecated`. > >  - [92a19cb](92a19cb604) *(list)* Highlight symbol styling by @airblast-dev in [#1595](https://github.com/ratatui/ratatui/pull/1595) [**breaking**] > Allow styling for `List`'s highlight symbol > > This change makes it so anything that implements `Into<Line>` can be > used as a highlight symbol. > > BREAKING CHANGE:`List::highlight_symbol` can no longer be used in const > context > > BREAKING CHANGE:`List::highlight_symbol` accepted `&str`. Conversion > methods that rely on type inference will need to be rewritten as the > compiler cannot infer the type. > > closes:https://github.com/ratatui/ratatui/issues/1443 > > --------- - [e89a526](e89a526aab) *(no_std)* Portable-atomic integration for targets with no atomic types by @j-g00da in [#2076](https://github.com/ratatui/ratatui/pull/2076) > Improves compatibility with no-std targets that don't support atomic > types. > > We support three different scenarios depending on the target: > 1. Terminal applications and other std targets (e.g. espidf): > - `std` enabled, `portable-atomic` disabled > 2. Embedded targets with atomic types, bare metal x86, etc.: > - `std` disabled `portable-atomic` disabled > 3. Embedded targets without atomic types (e.g. single-core MCUs): > - `std` disabled, `portable-atomic` enabled > > Turning on `portable-atomic` together with `std` will fall back to `std` > atomic. - [1399d95](1399d95ae0) *(no_std)* Make palette and serde features depends on std by @j-g00da in [#1919](https://github.com/ratatui/ratatui/pull/1919) - [b32f781](b32f78195b) *(no_std)* Make `ratatui-macros` no-std by @j-g00da in [#1865](https://github.com/ratatui/ratatui/pull/1865) - [3e1c72f](3e1c72fb27) *(no_std)* Make ratatui compatible with `#![no_std]` by @j-g00da in [#1794](https://github.com/ratatui/ratatui/pull/1794) [**breaking**] > > Resolves #1781 > > This PR makes it possible to compile ratatui with `#![no_std]`. > Also makes me answer "We Are So Embedded" to "Are We Embedded Yet?" - [ab48c06](ab48c06171) *(no_std)* Option to disable layout cache for `no_std` compatibility by @j-g00da in [#1795](https://github.com/ratatui/ratatui/pull/1795) [**breaking**] > > Resolves #1780 > > BREAKING CHANGE:Disabling `default-features` will now disable layout > cache, which can have a negative impact on performance. > > `Layout::init_cache` and `Layout::DEFAULT_CACHE_SIZE` are now only > available if `layout-cache` feature is enabled. - [09173d1](09173d1829) *(no_std)* Make `TestBackend::Error` `Infallible` by @j-g00da in [#1823](https://github.com/ratatui/ratatui/pull/1823) [**breaking**] > > BREAKING CHANGE:`TestBackend` now uses `core::convert::Infallible` for > error handling instead of `std::io::Error` - [007713e](007713e50a) *(no_std)* Replace `Backend`'s `io::Error` usages with associated `Error` type by @j-g00da in [#1778](https://github.com/ratatui/ratatui/pull/1778) [**breaking**] > > Resolves #1775 > > BREAKING CHANGE:Custom backends now have to implement `Backend::Error` > and `Backend::clear_region`. Additionally some generic `Backend` usage > will have to explicitly set trait bounds for `Backend::Error`. - [a42a17e](a42a17e184) *(no_std)* Make `ratatui-widgets` `no_std` by @j-g00da in [#1779](https://github.com/ratatui/ratatui/pull/1779) > > Resolves #1776 - [5a232a3](5a232a3115) *(no_std)* Remove redundant `std` usages in `ratatui-widgets` by @j-g00da in [#1762](https://github.com/ratatui/ratatui/pull/1762) - [ebe10cd](ebe10cd81f) *(no_std)* Remove redundant `std` usages in `ratatui-core` by @j-g00da in [#1753](https://github.com/ratatui/ratatui/pull/1753) > Resolves https://github.com/ratatui/ratatui/issues/1751 - [08b08cc](08b08cc45b) *(rect)* Centering by @janTatesa in [#1814](https://github.com/ratatui/ratatui/pull/1814) > > Resolves #617 - [ff729b7](ff729b7607) *(scrollbar)* Support retrieving the current position of state by @orhun in [#1552](https://github.com/ratatui/ratatui/pull/1552) > As of now it is possible to change the position of the Scrollbar but not > possible to retrieve the position for further use. e.g. > > ```rust > let mut state = ScrollbarState::default(); > state.next(); > ``` > > This commit adds a new method "`current_position`" (since `position` is > already taken by the fluent setter) for that purpose: > > ```rust > let index = state.get_position(); // yay > ``` > > See #1545 for the concrete usage of this. - [4c3c054](4c3c0540cd) *(serde)* Handle null modifiers in serde Style by @joshka in [#2172](https://github.com/ratatui/ratatui/pull/2172) > Allow `Style`'s `add_modifier` and `sub_modifier` fields to > deserialize from `null` - [b9da192](b9da1926a0) *(serde)* Derive Serialize/Deserialize for alignment enums by @j-g00da in [#1957](https://github.com/ratatui/ratatui/pull/1957) > > Resolves #1954 - [89b7421](89b74214d9) *(serde)* Derive Serialize/Deserialize for additional structs/enums by @aurreland in [#1883](https://github.com/ratatui/ratatui/pull/1883) > This PR adds `#[derive(Serialize, Deserialize)]` to the following > structs: > - `Constraint` > - `Direction` > - `Spacing` > - `Layout` > - `AccentedPalette` > - `NonAccentedPalette` > - `Palette` > - `Padding` > - `Borders` > - `BorderType` > - `ListDirection` > - `ScrollbarOrientation` > - `ScrollDirection` > - `RenderDirection` > - `HighlightSpacing` > > Fixes #1877 - [03f3f6d](03f3f6df35) *(style)* Allow add/sub modifiers to be omitted in Style serialization. by @rcorre in [#2057](https://github.com/ratatui/ratatui/pull/2057) > It's really useful that Style supports Deserialize, this allows TUI > apps to have configurable theming without much extra code. > > However, deserializing a style currently fails if `add_modifier` and > `sub_modifier` are > not specified. That means the following TOML config: > > ```toml > [theme.highlight] > fg = "white" > bg = "black" > ``` > > Will fail to deserialize with "missing field `add_modifier`". It should > be possible > to omit modifiers and have them default to "none". - [ee67347](ee673476d3) *(symbols)* Make `Marker` non-exhaustive by @j-g00da in [#2236](https://github.com/ratatui/ratatui/pull/2236) [**breaking**] > This will allow us to add new markers without causing further breaking > changes. > > BREAKING CHANGE:`Marker` is now non-exhaustive - [985cd05](985cd05573) *(symbols)* Add dashed borders by @theotchlx in [#1573](https://github.com/ratatui/ratatui/pull/1573) > Adds several new border sets: > - ratatui:🔣:border::LIGHT_DOUBLE_DASHED > - ratatui:🔣:border::HEAVY_DOUBLE_DASHED > - ratatui:🔣:border::LIGHT_TRIPLE_DASHED > - ratatui:🔣:border::HEAVY_TRIPLE_DASHED > - ratatui:🔣:border::LIGHT_QUADRUPLE_DASHED > - ratatui:🔣:border::HEAVY_QUADRUPLE_DASHED > > And corresponding variants to the ratatui::widgets::BorderType enum > > Fixes:https://github.com/ratatui/ratatui/issues/1355 - [4c301e8](4c301e891d) *(text)* Implement `AddAssign` for `Text` by @acuteenvy in [#1956](https://github.com/ratatui/ratatui/pull/1956) > This makes it possible to add a second `Text` instance to a first one using the += operator. > > ```rust > let mut text = Text::from("line 1"); > text += Text::from("line 2"); > ``` > > Style and alignment applied to the second text is ignored (though styles and alignment of lines and spans are copied). - [ce4856a](ce4856a65f) *(widgets)* Add the missing constructor to canvas types by @orhun in [#1538](https://github.com/ratatui/ratatui/pull/1538) > Allows constructing `Rectangle`, `Points` and `Circle` using the `new` > method instead of initializing with the public fields directly. - [22610b0](22610b019b) *(uncategorized)* Support adding an Offset to Position by @joshka in [#2239](https://github.com/ratatui/ratatui/pull/2239) > Adds Position::offset() and arithmentic ops (Position + Offset and > Position - Offset) > > Fixes:https://github.com/ratatui/ratatui/issues/2018 - [24e3133](24e3133456) *(uncategorized)* Add Rect::resize() method by @joshka in [#2240](https://github.com/ratatui/ratatui/pull/2240) > > Fixes:https://github.com/ratatui/ratatui/issues/1440 - [96d097e](96d097ef76) *(uncategorized)* Implement Rect ops for moving by @joshka in [#1596](https://github.com/ratatui/ratatui/pull/1596) > > feat:implement Rect ops for moving > > Implemented `Add`, `AddAssign`, `Sub`, and `SubAssign` on `Rect` for > `Offset`. This makes it possible to move rects > > ```rust > let rect = Rect::new(1, 2, 3, 4); > let moved = rect + Offset(1, 2); > let moved = rect - Offset(1, 2); > let moved = rect + Offset(-1, -2); > ``` > > Additionally Rect, Size, Offset, and Position now all have MIN and MAX > consts. - [e869cb9](e869cb9750) *(uncategorized)* Add Size::area() by @joshka in [#2226](https://github.com/ratatui/ratatui/pull/2226) > Add Size::area() returning u32 to avoid u16 overflow > Fixes https://github.com/ratatui/ratatui/issues/2204 - [b6588fd](b6588fd1fa) *(uncategorized)* Implement `From<Size>` for `(u16, u16)` by @0xb002f0 in [#2223](https://github.com/ratatui/ratatui/pull/2223) - [75b78be](75b78be09f) *(uncategorized)* Add width() impl for tabs by @joshka in [#2049](https://github.com/ratatui/ratatui/pull/2049) > The purpose of this is to make it easy for apps to easily calculate the > total tab width including all dividers and padding. - [8188ed3](8188ed3950) *(uncategorized)* Implement UnicodeWidthStr for Text/Line/Span by @joshka in [#2030](https://github.com/ratatui/ratatui/pull/2030) > You can now calculate the width of any Text/Line/Span using the > UnicodeWidthStr trait instead of the width method on the type. This also > makes it possible to use the width_cjk() method if needed. - [c845fec](c845fec765) *(uncategorized)* Add conversion from Size to Rect by @joshka in [#2028](https://github.com/ratatui/ratatui/pull/2028) > > `Rect::from(size)` returns a new Rect at the origin (0, 0) with the > specified `Size` - [017af11](017af11b2b) *(uncategorized)* Preserve block titles when merging borders by @j-g00da in [#1977](https://github.com/ratatui/ratatui/pull/1977) > > Resolves #1939 - [6dcd53b](6dcd53bc6b) *(uncategorized)* Add ergonomic methods for layouting Rects by @joshka in [#1909](https://github.com/ratatui/ratatui/pull/1909) > This commit introduces new methods for the `Rect` struct that simplify > the process of splitting a `Rect` into sub-rects according to a given > `Layout`. By putting these methods on the `Rect` struct, we make it a > bit more natural that a layout is applied to the `Rect` itself, rather > than passing a `Rect` to the `Layout` struct to be split. > > Adds:- `Rect::layout` and `Rect::try_layout` methods that allow splitting a > `Rect` into an array of sub-rects according to a given `Layout`. > - `Rect::layout_vec` method that returns a `Vec` of sub-rects. > - `Layout::try_areas` method that returns an array of sub-rects, with > compile-time checks for the number of constraints. This is added > mainly for consistency with the new `Rect` methods. > > ```rust > use ratatui_core::layout::{Layout, Constraint, Rect}; > let area = Rect::new(0, 0, 10, 10); > let layout = Layout::vertical([Constraint::Fill(1); 2]); > > // Rect::layout() infers the number of constraints at compile time: > let [top, main] = area.layout(&layout); > > // Rect::try_layout() and Layout::try_areas() do the same, but return a > // Result: > let [top, main] = area.try_layout(&layout)?; > let [top, main] = layout.try_areas(area)?; > > // Rect::layout_vec() returns a Vec of sub-rects: > let areas_vec = area.layout_vec(&layout); > > // you can also explicitly specify the number of constraints: > let areas = area.layout::<2>(&layout); > let areas = area.try_layout::<2>(&layout)?; > let areas = layout.try_areas::<2>(area)?; > ``` - [0c3872f](0c3872f1c5) *(uncategorized)* Add Rect::outer() by @joshka in [#1929](https://github.com/ratatui/ratatui/pull/1929) > > Fixes:https://github.com/ratatui/ratatui/issues/211 - [7bc78bc](7bc78bca1b) *(uncategorized)* Add ratatui::run() method by @joshka in [#1707](https://github.com/ratatui/ratatui/pull/1707) > This introduces a new `ratatui::run()` method which runs a closure with > a terminal initialized with reasonable defaults for most applications. > This calls `ratatui::init()` before running the closure and > `ratatui::restore()` after the closure completes, and returns the result > of the closure. > > A minimal hello world example using the new `ratatui::run()` method: > > ```rust > fn main() -> Result<(), Box<dyn std::error::Error>> { > ratatui::run(|terminal| { > loop { > terminal.draw(|frame| frame.render_widget("Hello World!", frame.area()))?; > if crossterm::event::read()?.is_key_press() { > break Ok(()); > } > } > }) > } > ``` > > Of course, this also works both with apps that use free methods and > structs: > > ```rust > fn run(terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } > > ratatui::run(run)?; > ``` > > ```rust > struct App { ... } > > impl App { > fn new() -> Self { ... } > fn run(mut self, terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } > } > > ratatui::run(|terminal| App::new().run(terminal))?; > ``` - [b6fbfcd](b6fbfcdd1c) *(uncategorized)* Add lifetime to symbol sets by @joshka in [#1935](https://github.com/ratatui/ratatui/pull/1935) > This makes it possible to create symbol sets at runtime with non-static > lifetimes. > > Fixes:https://github.com/ratatui/ratatui/issues/1722 - [488e5f0](488e5f020f) *(uncategorized)* Make `border!` work without importing `Borders` by @j-g00da in [#1918](https://github.com/ratatui/ratatui/pull/1918) > Currently using `border!` macro requires explicit import of `Borders` > which is unnecessary. - [671c2b4](671c2b4fd4) *(uncategorized)* Support merging the borders of blocks by @j-g00da > When two borders overlap, they will automatically merge into a single, > clean border instead of overlapping. > > This improves visual clarity and reduces rendering glitches around corners. > > For example: > > ``` > assert_eq!(Cell::new("┘").merge_symbol("┏", MergeStrategy::Exact).symbol(), "╆"); > ``` - [702fff5](702fff501c) *(uncategorized)* Implement stylize methods directly on Style by @joshka in [#1572](https://github.com/ratatui/ratatui/pull/1572) [**breaking**] > This makes it possible to create constants using the shorthand methods. > > ```rust > const MY_STYLE: Style = Style::new().blue().on_black(); > ``` > > Rather than implementing Styled for Style and then adding extension > methods that implement the Stylize shorthands, this implements the > methods as const functions directly on Style. > > BREAKING CHANGE:`Style` no longer implements `Styled`. Any calls to > methods implemented by the blanket implementation of Stylize are now > defined directly on Style. Remove the Stylize import if it is no longer > used by your code. > > The `reset()` method does not have a direct replacement, as it clashes > with the existing `reset()` method. Use `Style::reset()` rather than > `some_style.reset()` > > Fixes:#1158 - [4fcd238](4fcd238e1e) *(uncategorized)* Support no-std for calendar widget by @joshka in [#1852](https://github.com/ratatui/ratatui/pull/1852) > Removes the CalendarEventStore::today() function in no-std environments - [53cdbbc](53cdbbccd5) *(uncategorized)* Enable serde propagation to backend crates (crossterm, termion) by @ArjunKrish7356 in [#1812](https://github.com/ratatui/ratatui/pull/1812) > This PR propagates the serde feature from the main ratatui crate to the > ratatui-crossterm and ratatui-termion backend crates. Solves #1805 - [6836a69](6836a6903e) *(uncategorized)* Implement styled for other primitives by @aschey in [#1684](https://github.com/ratatui/ratatui/pull/1684) - [fcb47d6](fcb47d60f3) *(uncategorized)* Rename Alignment to HorizontalAlignment and add VerticalAlignment by @joshka in [#1735](https://github.com/ratatui/ratatui/pull/1735) [**breaking**] > We don't anticipate removing or deprecating the type alias in the near > future, but it is recommended to update your imports to use the new > name. > > Added a VerticalAlignment enum to make the API more consistent. We don't > have a specific use case for it yet, but it's better to add it now and > be able to use it in the future. > > BREAKING-CHANGE:The `Alignment` enum has been renamed to > `HorizontalAlignment` to better reflect its purpose. A type alias has > been added to maintain backwards compatibility, however there are some > cases where type aliases are not enough to maintain backwards > compatibility. E.g. when using glob imports to import all the enum > variants. This should not affect most users, but it is recommended to > update your imports to use the new name. > > ```diff > - use ratatui::layout::Alignment; > + use ratatui::layout::HorizontalAlignment; > > - use Alignment::*; > + use HorizontalAlignment::*; > ``` - [2714d6b](2714d6b9c3) *(uncategorized)* Add array and tuple RGB color conversion methods by @joshka in [#1703](https://github.com/ratatui/ratatui/pull/1703) > Other crates (e.g. colorgrad) that deal with colors can convert colors > to a tuple of 3 or 4 u8 values. This commit adds conversion methods from > these types to a `Color::Rgb` instance. Any alpha value is ignored. > > ```rust > Color::from([255, 0, 0]); > Color::from((255, 0, 0)); > Color::from([255, 0, 0, 255]); > Color::from((255, 0, 0, 255)); > ``` - [50ba965](50ba96518f) *(uncategorized)* Add a new RatatuiMascot widget by @Its-Just-Nans in [#1584](https://github.com/ratatui/ratatui/pull/1584) > Move the Mascot from Demo2 into a new widget. > Make the Rat grey and adjust the other colors. > > ```rust > frame.render_widget(RatatuiMascot::default(), frame.area()); > ``` - [1d28c89](1d28c89fe5) *(uncategorized)* Add conversions for anstyle by @joshka in [#1581](https://github.com/ratatui/ratatui/pull/1581) > > https://crates.io/crates/anstyle makes it possible to define colors in > an interoperable way. This makes it possible for applications to easily > load colors from a variety of formats. > > This is gated by the anstyle feature flag which is disabled by default. > > --------- ### Bug Fixes - [a89d3d6](a89d3d62ff) *(buffer)* Clear behavior with VS16 wide emojis by @nornagon in [#2063](https://github.com/ratatui/ratatui/pull/2063) > This fixes a bug where certain emojis like ⌨️ would sometimes be > "overlaid" onto existing content from the buffer, instead of properly > clearing. > > [example demonstrating > bug](https://gist.github.com/nornagon/11a79d7a1f2e98aa129fedb4abccc530) > > This PR was generated by Codex, and validated by me: > 1. Behavior of the above example code was buggy before this fix (showed > overlaying "b" on top of the keyboard emoji), and fixed after. > 2. The U+FE0F check is not strictly required, but I did note that emoji > without this char don't exhibit the buggy behavior, even without the > fix. > > --------- - [ec30390](ec30390446) *(canvas)* Round coordinates to nearest grid cell by @joshka in [#1507](https://github.com/ratatui/ratatui/pull/1507) > Previously the canvas coordinates were rounded towards zero, which > causes the rendering to be off by one pixel in some cases. It also meant > that pixels at the extreme edges of the canvas can only be drawn if the > point was exactly on the edge of the canvas. This commit rounds the > coordinates to the nearest integer instead. This may change the output > for some apps using Canvas / Charts. - [afd1ce1](afd1ce179b) *(canvas)* Lines that start outside the visible grid are now drawn by @renesat in [#1501](https://github.com/ratatui/ratatui/pull/1501) > Previously lines with points that were outside the canvas bounds were > not drawn at all. Now they are clipped to the bounds of the canvas so > that the portion of the line within the canvas is draw. > > To facilitate this, a new `Painter::bounds()` method which returns the > bounds of the canvas is added. > > Fixes:https://github.com/ratatui/ratatui/issues/1489 - [2b0a044](2b0a044ced) *(ci)* Add contents write permission to release-plz PR by @marcoieni in [#2119](https://github.com/ratatui/ratatui/pull/2119) > > https://release-plz.dev/docs/github/quickstart#3-setup-the-workflow > > Fixes https://github.com/release-plz/release-plz/issues/2439 - [18e70d3](18e70d3d51) *(crossterm)* Terminal should keep Bold when removing Dim by @MarSik in [#1541](https://github.com/ratatui/ratatui/pull/1541) > The Dim removal should behave the same as the logic for Bold removal > that sends NormalIntensity sequence and then restores Dim when needed. - [16b76e3](16b76e36ee) *(demo)* Update the width of demo2 tape by @orhun in [#2164](https://github.com/ratatui/ratatui/pull/2164) >  > > fixes #1721 - [dca331c](dca331c748) *(demo)* Support tab key in demo2 example by @orhun in [#1726](https://github.com/ratatui/ratatui/pull/1726) > > see #1721 > > Not sure what caused this - it's been there for a while probably and we > didn't realize it since we used `demo2-destroy` mostly. - [0fd4753](0fd4753e6b) *(examples)* Run the correct example for chart by @orhun in [#1679](https://github.com/ratatui/ratatui/pull/1679) > > fixes #1678 - [39479e2](39479e298c) *(examples)* Ensure that example projects are not published by @orhun in [#1672](https://github.com/ratatui/ratatui/pull/1672) - [9314312](93143126b3) *(layout)* Feature flag cache related types by @joshka in [#1842](https://github.com/ratatui/ratatui/pull/1842) - [2dd1977](2dd1977c59) *(layout-cache)* Import `NonZeroUsize` only when `layout-cache` is enabled by @j-g00da in [#1839](https://github.com/ratatui/ratatui/pull/1839) > This silences unused import warning, when `layout-cache` is disabled. - [564a9d7](564a9d76fc) *(line-gauge)* Pad default label to display 3 numbers by @martinetd in [#2053](https://github.com/ratatui/ratatui/pull/2053) > Display the default label of the LineGauge widget padded to fill 3 cells. > This makes it so that the label doesn't shift around when going from a > single digit to double / triple digits. > > To maintain the existing behavior, use a custom label by calling `.label()` > on the LineGauge. - [a692a6e](a692a6e371) *(lint)* Apply rust 1.84 clippy suggestions by @joshka in [#1612](https://github.com/ratatui/ratatui/pull/1612) > The canvas map constants are now statics instead. > Fixes > https://rust-lang.github.io/rust-clippy/master/index.html\#large_const_arrays - [2e54d5e](2e54d5e22c) *(macros)* Use $crate re-export in text macro by @airblast-dev in [#1832](https://github.com/ratatui/ratatui/pull/1832) - [79d5165](79d5165cae) *(no_std)* Propagate `std` feature flag to dependencies by @j-g00da in [#1838](https://github.com/ratatui/ratatui/pull/1838) > Disables `std` feature flags in dependencies and only enables them with > `ratatui` and `ratatui-core`'s `std` feature flag. This partially fixes the > issue of still depending on `std`, when `std` feature flag is disabled. - [00da8c6](00da8c6203) *(no_std)* Provide `f64` polyfills for `no_std` compatibility by @j-g00da in [#1840](https://github.com/ratatui/ratatui/pull/1840) > > Related:https://github.com/rust-lang/rust/issues/137578 - [3b13240](3b13240728) *(scrollbar)* Check for area.is_empty() before rendering by @farmeroy in [#1529](https://github.com/ratatui/ratatui/pull/1529) > This adds the `area.is_empty()` back into the scrollbar render method. > Without it, the widget panics if the height is 0. - [f57b696](f57b696fdc) *(span)* Dont render control characters by @EdJoPaTo in [#1312](https://github.com/ratatui/ratatui/pull/1312) - [2ce958e](2ce958e38c) *(table)* Allow display of additional table row, if row height > 1 by @Lunderberg in [#1452](https://github.com/ratatui/ratatui/pull/1452) - [0a25bc1](0a25bc166d) *(tests)* Update the stderr snapshot for ratatui-macros by @orhun in [#2161](https://github.com/ratatui/ratatui/pull/2161) > New 🦀 broke the CI - [5fa342c](5fa342cc52) *(widgets)* Fix centered block title truncation by @ognis1205 in [#1973](https://github.com/ratatui/ratatui/pull/1973) > Previously block titles that were aligned center were > truncated poorly (aligned to the left, and the last > non-fitting title would be truncated on the left and right. > This now truncates the titles more obviously centered. - [f919b25](f919b25ea6) *(uncategorized)* String_to_string lint is now part of implicit_clone by @joshka in [#2173](https://github.com/ratatui/ratatui/pull/2173) - [1fe64de](1fe64de09a) *(uncategorized)* Include underline color in anstyle conversion by @aschey in [#2004](https://github.com/ratatui/ratatui/pull/2004) > Underline color wasn't included in the style conversion logic. - [c1b8528](c1b8528b69) *(uncategorized)* Panic when rendering widgets on too small buffer by @j-g00da in [#1996](https://github.com/ratatui/ratatui/pull/1996) > Fixes panic on overflow on horizontal `Barchart` and `RatatuiMascot` and adds proper tests to all widgets. > > --------- - [08b21fa](08b21fa55c) *(uncategorized)* Fix panic when rendering a `Paragraph` out of bounds by @jwodder in [#1670](https://github.com/ratatui/ratatui/pull/1670) > > Fixes #1667. - [80bc818](80bc818723) *(uncategorized)* Fix truncation of left aligned block titles by @joshka in [#1931](https://github.com/ratatui/ratatui/pull/1931) > truncate the right side of left aligned titles rather than the left side > of right aligned titles. This is more obvious as the left side of text > often contains more important information. And we generally read > left to right. > > This change makes centered titles overwrite left aligned titles and > right aligned titles overwrite centered or left aligned titles. > > Fixes:https://github.com/ratatui/ratatui/issues/358 - [21e3b59](21e3b598ce) *(uncategorized)* Fix handling of multi-byte chars in bar chart by @joshka in [#1934](https://github.com/ratatui/ratatui/pull/1934) > The split_at method requires that the split point is at a valid utf8 > character boundary. > > Fixes:https://github.com/ratatui/ratatui/issues/1928 - [e1e4004](e1e400406c) *(uncategorized)* Derive copy for list state by @janTatesa in [#1921](https://github.com/ratatui/ratatui/pull/1921) - [12cb5a2](12cb5a28fe) *(uncategorized)* Allow canvas area to exceed u16::MAX by @Daksh14 in [#1891](https://github.com/ratatui/ratatui/pull/1891) > This allows Canvas grids where the width * height exceeds u16::MAX by > converting values to usize earlier in several methods. > > Fixes:https://github.com/ratatui/ratatui/issues/1449 - [09cc9ef](09cc9ef57d) *(uncategorized)* Typo in changelog by @joshka in [#1857](https://github.com/ratatui/ratatui/pull/1857) - [c238aca](c238aca83a) *(uncategorized)* `padding_right()` should set right padding instead of left by @sxyazi in [#1837](https://github.com/ratatui/ratatui/pull/1837) > Fixes https://github.com/ratatui/ratatui/issues/1836 - [c90ba97](c90ba9781e) *(uncategorized)* Avoid unnecessary imports in minimal build by @cgzones in [#1787](https://github.com/ratatui/ratatui/pull/1787) > > core::ops::Range is only used with the feature `scrolling-regions`. > Ensure a minimal `cargo check` reports no warnings. - [416ebdf](416ebdf8c8) *(uncategorized)* Correct clippy errors introduced by rust 1.86.0 update by @j-g00da in [#1755](https://github.com/ratatui/ratatui/pull/1755) > New version of rust (1.86.0) caused CI to fail. - [4eac5b2](4eac5b2849) *(uncategorized)* Make deprecation notes more helpful by @joshka in [#1702](https://github.com/ratatui/ratatui/pull/1702) > AI coding assistants use the deprecation notes to automatically suggest > fixes. This commit updates the deprecation notes to push those tools to > suggest the correct replacement methods and types. > > Specifically, AI tools often suggest using `Buffer::get(x, y)`, because > of their training data where this was prevalent. When fixing these > deprecations, they often incorrectly suggest using `Buffer::get(x, y)` > instead of `Buffer[(x, y)]`. - [35a8642](35a86427ab) *(uncategorized)* `Rect::positions()` should be empty when width is 0 and height is nonzero by @jwodder in [#1669](https://github.com/ratatui/ratatui/pull/1669) > > Fixes #1666. - [f5fc819](f5fc8197ff) *(uncategorized)* Avoid extra line break on whitespace only lines when wrapping paragraphs by @dotdash in [#1636](https://github.com/ratatui/ratatui/pull/1636) > Currently whitespace only lines produces an extra line break when > trimming is disabled, because both the trimmed as well as the > non-trimmed line get inserted. Fix this by only inserting the > non-trimmed one. - [2892bdd](2892bddce6) *(uncategorized)* Rust 1.83 clippy lints by @joshka in [#1527](https://github.com/ratatui/ratatui/pull/1527) > > https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes - [36e2d1b](36e2d1bda1) *(uncategorized)* Add feature(doc_cfg) when generating docs by @joshka in [#1506](https://github.com/ratatui/ratatui/pull/1506) - [4d7704f](4d7704fba5) *(uncategorized)* Make StatefulWidget and Ref work with unsized State by @thscharler in [#1505](https://github.com/ratatui/ratatui/pull/1505) > > StatefulWidget::State and StatefulWidgetRef::State are now ?Sized. > > This allows implementations of the traits to use unsized types for the > State associated type. This is turn is useful when doing things like > boxing different stateful widget types with State which implements > `Any`, are slices or any other dynamically sized type. - [7b87509](7b875091e1) *(uncategorized)* Typo by @marcoieni in [#1480](https://github.com/ratatui/ratatui/pull/1480) ### Refactor - [8d60e96](8d60e96b2b) *(examples)* Use crossterm event methods by @joshka in [#1792](https://github.com/ratatui/ratatui/pull/1792) > Crossterm 0.29 introduced methods to easily check / extract the event > type. E.g. as_key_press_event() and is_key_press(). This commit > updates the examples to use these methods instead of matching on > the event type. This makes the code cleaner and easier to read. > > Also does a general cleanup of the event handling code in the examples. - [07bec55](07bec55b7d) *(no_std)* Make usages of std explicit in ratatui-core. by @ed-2100 in [#1782](https://github.com/ratatui/ratatui/pull/1782) > ### This commit does the following: > > - Adds `#[no_std]` to `lib.rs`. > - Adds `extern crate std;` to `lib.rs`. > - Updates `ratatui-core` to explicitly `use` items from std and alloc. > - Prefers `use`-ing alloc over std when possible. > > ### Explanation: > > This allows usages of `std` in `ratatui-core` to be clearly pointed out > and dealt with individually. > > Eventually, when `std` is to be feature gated, the associated commit > will be much cleaner. - [f132fa1](f132fa1715) *(table)* Small readability improvements by @joshka in [#1510](https://github.com/ratatui/ratatui/pull/1510) - [c7c3498](c7c3498025) *(uncategorized)* Use saturating_add in Rect::new by @pharrison31415 in [#2216](https://github.com/ratatui/ratatui/pull/2216) - [02e53de](02e53de0f8) *(uncategorized)* Make use of iter::repeat_n() by @cgzones in [#1788](https://github.com/ratatui/ratatui/pull/1788) > Applied via clippy --fix. > Available since 1.82.0. - [a195d59](a195d59a47) *(uncategorized)* Move xtask commands to small modules by @joshka in [#1620](https://github.com/ratatui/ratatui/pull/1620) - [904b0aa](904b0aa723) *(uncategorized)* Move symbols to modules by @joshka in [#1594](https://github.com/ratatui/ratatui/pull/1594) - [7c8573f](7c8573f575) *(uncategorized)* Rearrange selection_spacing code by @raylu in [#1540](https://github.com/ratatui/ratatui/pull/1540) - [217c57c](217c57cd60) *(uncategorized)* Modularize backends by @orhun in [#1508](https://github.com/ratatui/ratatui/pull/1508) > Backend code is now moved to `ratatui-crossterm`, `ratatui-termion` and > `ratatui-termwiz`. This should be backwards compatible with existing code. - [e461b72](e461b724a6) *(uncategorized)* Move {Stateful,}Widget{,Ref} types into individual files by @joshka in [#1479](https://github.com/ratatui/ratatui/pull/1479) > This is a preparatory refactoring for modularization. No user visible > changes. ### Documentation - [40e96a2](40e96a2a04) *(block)* Add collapsed border example by @joshka in [#1899](https://github.com/ratatui/ratatui/pull/1899) - [d291042](d291042e69) *(block)* Revise the block example by @orhun in [#1520](https://github.com/ratatui/ratatui/pull/1520) > - Moves the block example from `ratatui` to `ratatui-widgets` > - Simplifies the example (bordered, styled, custom borders) > > see #1512 - [0951da5](0951da52f9) *(breaking-changes)* Improve migration guide for `Backend::Error` by @j-g00da in [#1908](https://github.com/ratatui/ratatui/pull/1908) > > Related:https://github.com/fujiapple852/trippy/pull/1588 - [bbe1cf9](bbe1cf9497) *(breaking-changes)* Change MSRV to 1.85 by @j-g00da in [#1896](https://github.com/ratatui/ratatui/pull/1896) > The minimum supported Rust version is now for `ratatui` v0.30 is 1.85 - [c7912f3](c7912f3990) *(breaking-changes)* Fix header level by @j-g00da in [#1825](https://github.com/ratatui/ratatui/pull/1825) - [fcde9cb](fcde9cb9c3) *(changelog)* Fix typo by @orhun in [#1463](https://github.com/ratatui/ratatui/pull/1463) - [73488ab](73488abb45) *(contributing)* Fix link to `widgets_block_renders` test by @ognis1205 in [#2101](https://github.com/ratatui/ratatui/pull/2101) > The `CONTRIBUTING.md` referenced `tests/widgets_block.rs`, but the > correct path is `ratatui/tests/widgets_block.rs`. Updated the link so > that readers can navigate to the test example without 404 error. > > --------- - [0b025db](0b025db72b) *(contributing)* Fix grammar by @j-g00da in [#1958](https://github.com/ratatui/ratatui/pull/1958) - [1197b2a](1197b2a02c) *(contributing)* Add note about using nightly for formatting by @joshka in [#1816](https://github.com/ratatui/ratatui/pull/1816) - [3ae6bf1](3ae6bf1d6f) *(contributing)* Use cargo-xtask for instructions by @orhun in [#1509](https://github.com/ratatui/ratatui/pull/1509) > - Updates `CONTRIBUTING.md` about the usage of `xtask` > - Removes `Makefile.toml` - [22e3e84](22e3e84de8) *(core)* Remove link to Paragraph widget by @orhun in [#1683](https://github.com/ratatui/ratatui/pull/1683) - [b65788c](b65788ce14) *(examples)* Remove duplicated link by @matthiasbeyer in [#2212](https://github.com/ratatui/ratatui/pull/2212) - [200b217](200b217722) *(examples)* Add VHS tapes and docs for widget examples by @orhun in [#2114](https://github.com/ratatui/ratatui/pull/2114) > > fixes #1982 > > Later on I'll figure out an easy way to regenerate this in the CI and > possibly do the same for the app examples' VHS tapes. That's why I > haven't added a script or mentioned anything in the docs yet (hint: > #1721) > > --------- - [861fbdf](861fbdf5cf) *(examples)* Fix a typo by @j-g00da in [#1890](https://github.com/ratatui/ratatui/pull/1890) > Makes CI typos check pass again - [882cc3c](882cc3c6c6) *(examples)* Update app examples with tapes by @orhun in [#1673](https://github.com/ratatui/ratatui/pull/1673) - [4393fae](4393fae54c) *(examples)* Move scrollbar example to examples folder by @orhun in [#1665](https://github.com/ratatui/ratatui/pull/1665) - [9ea70e2](9ea70e28c6) *(examples)* Move widget-impl example to examples folder by @orhun in [#1663](https://github.com/ratatui/ratatui/pull/1663) - [774ab78](774ab788d4) *(examples)* Move widget-ref-container example to examples folder by @orhun in [#1664](https://github.com/ratatui/ratatui/pull/1664) > > see #1512 - [910d16e](910d16e63a) *(examples)* Move user-input example to examples folder by @orhun in [#1659](https://github.com/ratatui/ratatui/pull/1659) - [dbfb7da](dbfb7da9e3) *(examples)* Move table example to examples folder by @orhun in [#1657](https://github.com/ratatui/ratatui/pull/1657) - [cb2a58a](cb2a58aaa0) *(examples)* Move tracing example to examples folder by @orhun in [#1658](https://github.com/ratatui/ratatui/pull/1658) - [7e00b64](7e00b646fc) *(examples)* Move panic example to examples folder by @orhun in [#1655](https://github.com/ratatui/ratatui/pull/1655) - [8127590](8127590812) *(examples)* Move modifiers example to examples folder by @orhun in [#1654](https://github.com/ratatui/ratatui/pull/1654) - [7c40c0b](7c40c0bbdd) *(examples)* Move popup example to examples folder by @orhun in [#1656](https://github.com/ratatui/ratatui/pull/1656) > > see #1512 - [d87354f](d87354f400) *(examples)* Move list example to examples folder by @orhun in [#1653](https://github.com/ratatui/ratatui/pull/1653) > > see #1512 > > also renames it to todo-list - [621226f](621226f2e2) *(examples)* Move inline example to examples folder by @orhun in [#1651](https://github.com/ratatui/ratatui/pull/1651) - [9ba7d25](9ba7d25b71) *(examples)* Move hyperlink example to examples folder by @orhun in [#1650](https://github.com/ratatui/ratatui/pull/1650) - [bb94d1c](bb94d1c0fa) *(examples)* Move minimal example to examples folder by @orhun in [#1649](https://github.com/ratatui/ratatui/pull/1649) - [9f399ac](9f399ac7a6) *(examples)* Move gauge example to examples folder by @orhun in [#1646](https://github.com/ratatui/ratatui/pull/1646) - [104d6a6](104d6a6c2b) *(examples)* Move custom-widget example to examples folder by @orhun in [#1644](https://github.com/ratatui/ratatui/pull/1644) - [fa8ca01](fa8ca0121a) *(examples)* Move flex example to examples folder by @orhun in [#1642](https://github.com/ratatui/ratatui/pull/1642) - [f5fde0e](f5fde0ef53) *(examples)* Move constraints example to examples folder by @orhun in [#1641](https://github.com/ratatui/ratatui/pull/1641) - [fc70288](fc70288954) *(examples)* Move constraint-explorer example to examples folder by @orhun in [#1640](https://github.com/ratatui/ratatui/pull/1640) - [325f961](325f96102a) *(examples)* Move hello-world example to examples folder by @orhun in [#1647](https://github.com/ratatui/ratatui/pull/1647) - [867c4bc](867c4bc4e9) *(examples)* Move colors-rgb example to examples folder by @joshka in [#1582](https://github.com/ratatui/ratatui/pull/1582) > - **docs: move colors-rgb example to examples folder** > - **docs: update main examples README** > > --------- - [72334ed](72334ed61c) *(layout)* Update documentation to point to `kasuari` solver by @a-kenji in [#2003](https://github.com/ratatui/ratatui/pull/2003) - [2be9ccb](2be9ccb120) *(layout)* Remove unnecessary path prefix by @j-g00da in [#1766](https://github.com/ratatui/ratatui/pull/1766) - [b669ceb](b669cebcaf) *(layout)* Change `cassowary` to `kasuari` crate reference by @j-g00da in [#1765](https://github.com/ratatui/ratatui/pull/1765) - [f907c74](f907c74bb3) *(license)* Update copyright years by @LVivona in [#1639](https://github.com/ratatui/ratatui/pull/1639) > Update MIT Licence to copyright year 2025 - [68b9f67](68b9f67f59) *(readme)* Add `Built with Ratatui` badge for downstream projects by @harilvfs in [#1905](https://github.com/ratatui/ratatui/pull/1905) - [088aac1](088aac136d) *(readme)* Tweak links and badges by @joshka in [#1598](https://github.com/ratatui/ratatui/pull/1598) - [6e43672](6e436725e4) *(readme)* Reimagine README.md by @orhun in [#1569](https://github.com/ratatui/ratatui/pull/1569) > This is the result of the re-imagination of a more suitable README.md. It > is simpler and shorter: not giving more information to the user than > they actually need. > > Also updates the quickstart code with the up-to-date version and adds > link to templates which was missing. > > --------- - [8f28247](8f282473b2) *(readme)* Correct examples links by @HoKim98 in [#1484](https://github.com/ratatui/ratatui/pull/1484) - [9f90f74](9f90f7495f) *(readme)* Fix broken link by @nilsmartel in [#1485](https://github.com/ratatui/ratatui/pull/1485) - [260af68](260af68a34) *(readme)* Include iocraft as an alternative by @kdheepak in [#1483](https://github.com/ratatui/ratatui/pull/1483) - [8e5151f](8e5151f83d) *(rect)* Fix typo in the Rect::outer function comments by @orhun in [#2123](https://github.com/ratatui/ratatui/pull/2123) - [40f13c6](40f13c6a6c) *(rect)* Update the outdated comment for Rect::area() by @isgin01 in [#2100](https://github.com/ratatui/ratatui/pull/2100) > The return value of Rect.area() is no longer of u16 type, and the value > is not being clumped anymore. - [ce16692](ce16692b9a) *(release)* Fix typo by @j-g00da in [#1754](https://github.com/ratatui/ratatui/pull/1754) - [9a930a6](9a930a6e99) *(terminal)* Made usage of Terminal::get_frame() clearer by @Blaeriz in [#2071](https://github.com/ratatui/ratatui/pull/2071) > Closes : https://github.com/ratatui/ratatui/issues/1200 > > --------- - [b08b4cb](b08b4cbd5e) *(terminal)* Add disclaimer about panics to Terminal::new by @lolbinarycat in [#2088](https://github.com/ratatui/ratatui/pull/2088) > > part of #2087 > > cc @orhun > > --------- - [dafb716](dafb716f9d) *(widgets)* Add example for grouped barchart by @orhun in [#1566](https://github.com/ratatui/ratatui/pull/1566) > > related #1512 > > --------- - [ed5dd73](ed5dd73084) *(widgets)* Add example for tabs by @orhun in [#1559](https://github.com/ratatui/ratatui/pull/1559) > > related #1512 > > Also removes the tabs example from ratatui crate since it overlaps with > this new example in terms of functionality and it was not following the > general theme of other examples. - [fab5321](fab532171d) *(widgets)* Add example for scrollbar by @orhun in [#1545](https://github.com/ratatui/ratatui/pull/1545) > Related to: #1512 - [898aef6](898aef6e2f) *(widgets)* Add example for list by @orhun in [#1542](https://github.com/ratatui/ratatui/pull/1542) > Related to: #1512 - [452366a](452366aa9e) *(widgets)* Add example for sparkline by @orhun in [#1556](https://github.com/ratatui/ratatui/pull/1556) > > related #1512 > > Also removes the sparkline example from ratatui crate since this example > is a simplified and easier to understand version of that - [6ddde0e](6ddde0e8a8) *(widgets)* Add example for table by @orhun in [#1557](https://github.com/ratatui/ratatui/pull/1557) > > related #1512 - [93ad6b8](93ad6b828c) *(widgets)* Update values in chart example by @orhun in [#1558](https://github.com/ratatui/ratatui/pull/1558) > better stonks - [15f442a](15f442a71e) *(widgets)* Add example for paragraph by @orhun in [#1544](https://github.com/ratatui/ratatui/pull/1544) > > related #1512 > > Also removes the paragraph example from `ratatui` since these examples > are more or less the same. - [17bba14](17bba14540) *(widgets)* Move the logo example to widgets by @orhun in [#1543](https://github.com/ratatui/ratatui/pull/1543) > > related #1512 > > Also updates the code to make it consistent with the other examples - [f2451e7](f2451e7f1e) *(widgets)* Add example for gauge by @orhun in [#1539](https://github.com/ratatui/ratatui/pull/1539) > > related #1512 - [4f0a8b2](4f0a8b21af) *(widgets)* Add example for canvas by @orhun in [#1533](https://github.com/ratatui/ratatui/pull/1533) > > related #1512 - [91147c4](91147c4d75) *(widgets)* Add example for chart by @orhun in [#1536](https://github.com/ratatui/ratatui/pull/1536) > stonks - [6dd25a3](6dd25a3111) *(widgets)* Add example for calendar by @orhun in [#1532](https://github.com/ratatui/ratatui/pull/1532) > > related #1512 - [99ac005](99ac005b06) *(widgets)* Add simple barchart example by @joshka in [#1511](https://github.com/ratatui/ratatui/pull/1511) - [b1d47e7](b1d47e7718) *(uncategorized)* Discourage use of `Buffer`'s `pos_of`, `index_of` by @pharrison31415 in [#2225](https://github.com/ratatui/ratatui/pull/2225) > These methods assume that the backing store of any buffer / area is linearly indexable. There are other ways that we might want to experiment in the future with how to store the values (trees, 2D allocated areas that are non-contiguous etc.). The index <-> pos conversion there isn't particularly useful. This should be an internal implementation detail of the buffer, rather than something that we expose, but we're not deprecating this for now at least. - [f8b0594](f8b0594363) *(uncategorized)* Fix: fix typos by @j-g00da in [#2129](https://github.com/ratatui/ratatui/pull/2129) > This fixes the pipeline after bumping typos. - [9998000](9998000e36) *(uncategorized)* Use shields.io badge by @LitoMore in [#2040](https://github.com/ratatui/ratatui/pull/2040) > Related to: > - https://github.com/simple-icons/simple-icons/pull/13593 > - https://github.com/ratatui/ratatui/pull/1967 > > The Ratatui icon is available on shields.io now ✌️ > > And it's customizable. There are more configurations at > https://shields.io/badges. > > Here are some examples: > > ```markdown >  is a Rust crate for cooking up terminal user interfaces (TUIs). It provides a simple and flexible way to create text-based user interfaces in the terminal, which can be used for command-line applications, dashboards, and other interactive console programs.
Quickstart
Ratatui has templates available to help you get started quickly. You can use the
cargo-generate command to create a new project with Ratatui:
cargo install --locked cargo-generate
cargo generate ratatui/templates
Selecting the Hello World template produces the following application:
use color_eyre::Result;
use crossterm::event::{self, Event};
use ratatui::{DefaultTerminal, Frame};
fn main() -> Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let result = run(terminal);
ratatui::restore();
result
}
fn run(mut terminal: DefaultTerminal) -> Result<()> {
loop {
terminal.draw(render)?;
if matches!(event::read()?, Event::Key(_)) {
break Ok(());
}
}
}
fn render(frame: &mut Frame) {
frame.render_widget("hello world", frame.area());
}
Documentation
- Docs - the full API documentation for the library on docs.rs.
- Ratatui Website - explains the library's concepts and provides step-by-step tutorials.
- Ratatui Forum - a place to ask questions and discuss the library.
- Widget Examples - a collection of examples that demonstrate how to use the library.
- App Examples - a collection of more complex examples that demonstrate how to build apps.
- ARCHITECTURE.md - explains the crate organization and modular workspace structure.
- Changelog - generated by git-cliff utilizing Conventional Commits.
- Breaking Changes - a list of breaking changes in the library.
You can also watch the EuroRust 2024 talk to learn about common concepts in Ratatui and what's possible to build with it.
Templates
If you're looking to get started quickly, you can use one of the available templates from the
templates repository using cargo-generate:
cargo generate ratatui/templates
Built with Ratatui
Check out the showcase section of the website, or the awesome-ratatui repository for a curated list of awesome apps and libraries built with Ratatui!
Alternatives
Contributing
Feel free to join our Discord server for discussions and questions! There is also a Matrix bridge available at #ratatui:matrix.org. We have also recently launched the Ratatui Forum.
We rely on GitHub for bugs and feature requests.
Please make sure you read the contributing guidelines before creating a pull request. We accept AI generated code, but please read the AI Contributions guidelines to ensure compliance.
If you'd like to show your support, you can add the Ratatui badge to your project's README:
[](https://ratatui.rs/)
Acknowledgements
Ratatui was forked from the tui-rs crate in 2023 in order to continue its development. None of this could be possible without Florian Dehau who originally created tui-rs which inspired many Rust TUIs.
Special thanks to Pavel Fomchenkov for his work in designing an awesome logo for the Ratatui project and organization.
License
This project is licensed under the MIT License.
