# Breaking Changes This document contains a list of breaking changes in each version and some notes to help migrate between versions. It is compiled manually from the commit history and changelog. We also tag PRs on github with a [breaking change] label. [breaking change]: (https://github.com/ratatui-org/ratatui/issues?q=label%3A%22breaking+change%22) ## Summary This is a quick summary of the sections below: - [v0.26.0 (unreleased)](#v0260-unreleased) - `patch_style` & `reset_style` now consume and return `Self` - Removed deprecated `Block::title_on_bottom` - `Line` now has an extra `style` field which applies the style to the entire line - `Block` style methods cannot be created in a const context - [v0.25.0](#v0250) - Removed `Axis::title_style` and `Buffer::set_background` - `List::new()` now accepts `IntoIterator>>` - `Table::new()` now requires specifying the widths - `Table::widths()` now accepts `IntoIterator>` - Layout::new() now accepts direction and constraint parameters - The default `Tabs::highlight_style` is now `Style::new().reversed()` - [v0.24.0](#v0240) - MSRV is now 1.70.0 - `ScrollbarState`: `position`, `content_length`, and `viewport_content_length` are now `usize` - `BorderType`: `line_symbols` is now `border_symbols` and returns `symbols::border::set` - `Frame<'a, B: Backend>` is now `Frame<'a>` - `Stylize` shorthands for `String` now consume the value and return `Span<'static>` - `Spans` is removed - [v0.23.0](#v0230) - `Scrollbar`: `track_symbol` now takes `Option<&str>` - `Scrollbar`: symbols moved to `symbols` module - MSRV is now 1.67.0 - [v0.22.0](#v0220) - serde representation of `Borders` and `Modifiers` has changed - [v0.21.0](#v0210) - MSRV is now 1.65.0 - `terminal::ViewPort` is now an enum - `"".as_ref()` must be annotated to implement `Into>` - `Marker::Block` renders as a block char instead of a bar char - [v0.20.0](#v0200) - MSRV is now 1.63.0 - `List` no longer ignores empty strings ## v0.26.0 (unreleased) ### `patch_style` & `reset_style` now consumes and returns `Self` ([#754]) [#754]: https://github.com/ratatui-org/ratatui/pull/754 Previously, `patch_style` and `reset_style` in `Text`, `Line` and `Span` were using a mutable reference to `Self`. To be more consistent with the rest of `ratatui`, which is using fluent setters, these now take ownership of `Self` and return it. The following example shows how to migrate for `Line`, but the same applies for `Text` and `Span`. ```diff - let mut line = Line::from("foobar"); - line.patch_style(style); // becomes + let line = Line::new("foobar").patch_style(style); ``` ### Remove deprecated `Block::title_on_bottom` ([#757]) [#757]: https://github.com/ratatui-org/ratatui/pull/757 `Block::title_on_bottom` was deprecated in v0.22. Use `Block::title` and `Title::position` instead. ```diff - block.title("foobar").title_on_bottom(); + block.title(Title::from("foobar").position(Position::Bottom)); ``` ### `Block` style methods cannot be used in a const context ([#720]) [#720]: https://github.com/ratatui-org/ratatui/pull/720 Previously the `style()`, `border_style()` and `title_style()` methods could be used to create a `Block` in a constant context. These now accept `Into