⚠️ See the breaking changes for this release.
Ratatui Website 📚
Here are some of the sections that we recommend checking out:
All the code is available at https://github.com/ratatui-org/website
Check out the good first issues here if you are interested in contributing to our website!
Awesome Ratatui 🦀
We created an awesome list for curating the awesome applications/libraries built with
If you have something built with/for Ratatui, feel free to add it to this list!
Ratatui Templates 📝
We gathered the available
ratatui templates under a single repository:
Currently, we have two templates:
- Simple: A template for bootstrapping a simple
- Async: A more advanced template which uses crates such as
tracingfor creating an async
They can be used with
This repository is still under construction so feel free to take a look and help us out. Additionally, we really appreciate if you have another template and interested in contributing it.
New/Updated Examples 🆕
We added a new example
shows how to render a big text using half blocks.
We also updated the
colors_rgb example to
add animation and a FPS counter.
List: Better Construction ✨
List::new now accepts
IntoIterator<Item = Into<ListItem>> which means you can build a
However, this change will throw a compilation error for
IntoIterators with an indeterminate item
(e.g. empty vectors):
List: Line Alignment 📏
List widget now respects the alignment of
Lines and renders them as expected.
Will result in a list:
The previous name
start_corner did not communicate clearly the intent of the method.
A new method
List::direction and a new enum
ListDirection were added.
List::start_corner is now deprecated.
Layout: Better Construction ✨
We added a convenience function to create a layout with a direction and a list of constraints which are the most common parameters that would be generally configured using the builder pattern.
The constraints can be passed in as any iterator of constraints.
Layout: Allow Configuring Fill 🖌️
The layout split will generally fill the remaining area when
split() is called.
With this feature, we now allow the caller to configure how any extra space is allocated to the
Rects. This is useful for cases where the caller wants to have a fixed size for one of the
Rects, and have the other
Rects fill the remaining space.
To use this feature, add
unstable-segment-size feature flag to
reason for this is that the exact name for the types is still being bikeshedded.
The default behavior is
SegmentSize::LastTakesRemainder, which gives the last segment the
SegmentSize::None will disable this behavior.
To configure the layout to fill the remaining space evenly, use
See the documentation for
layout::SegmentSize for more information.
Table: Segment Size 🗃️
Similarly to the previous entry, this works just like
Layout::segment_size but for tables:
It controls how to distribute extra space to an underconstrained table. The default, legacy behavior is to leave the extra space unused.
The new options are
LastTakesRemainder which gets all space to the rightmost column that can used
EvenDistribution which divides it amongst all columns.
Table: Width Improvements ✨
Table::new() now requires specifying the widths of the columns
Tables could be constructed without widths. In almost all cases this is an error so we
widths parameter mandatory.
Which means you need to update your existing code to:
For ease of automated replacement, in cases where the amount of code broken by this change is large
or complex, it may be convenient to replace
Table::widths() now accepts
This allows passing an array, slice or Vec of constraints, which is more ergonomic than requiring this to always be a slice.
Constraint Helpers 🆘
We added helper methods that convert from iterators of
u16 values to the specific
This makes it easy to create constraints like:
We now have a new unstable feature which helps getting information about a rendered paragraph
unstable-rendered-line-info feature flag to get access to the following
Paragraph::line_count: Takes a bounding width and returns the number of lines necessary to display the full paragraph when rendered. The motivation for this method is to use it with scrollbars. If a paragraph has wrapped text, it is currently impossible to get the number of lines it will need.
Paragraph::line_width: Returns the smallest line width needed to fully display every line of a paragraph. This is simply the maximum line widths.
Together, these two methods can be used to calculate the minimum bounding box for a paragraph. Please note that they are experimental and may change in the future.
Rect has a new method called
offset and it can be used to create a new Rect that is moved by the
amount specified in the x and y direction. These values can be positive or negative. This is useful
for manual layout tasks.
IntoIterator for Constraints 🔄
Table now accept
IntoIterator for constraints with an Item that is
This allows pretty much any collection of constraints to be passed to the layout functions including arrays, vectors, slices, and iterators (without having to call collect() on them).
Chart: Legend Position 📊
Chart has a new setter method called
Chart::LegendPosition for other possible values.
Default Highlight Style 🎨
Previously the default
highlight_style was set to
Style::default(), which meant that the
highlight style was the same as the normal style.
This means that for example a
Tabs widget in the default configuration would not show any
indication of the selected tab.
Now we set the
highlight_style to the reversed style (
Style::new().reversed()) as default.
Tab: Custom Padding 📇
The Tab widget now contains
Those values can be set with functions
For convenience, you can also use the
padding method to set left/right padding accordingly:
Cell::symbol field is now accessible via a getter method (
symbol()). This will allow us to
make future changes to the Cell internals such as replacing
Remove Deprecated Items 💀
Buffer::set_background which were deprecated since
- Add new setter methods:
- Rewrite the
Terminalto fix a bug and remove the height cap
WrappedLinestruct to reflow module
- Add documentation to
ListItemand many other parts of the codebase
- Reorganize the modules/documentation to respect the natural reading order
- Remove unnecessary dynamic dispatch and heap allocation from widgets
- Add Vim key bindings (movement) to the examples
#[must_use]to fluent setter methods
- Create a security policy
- Bump MSRV to
And lastly, we welcome @Valentin271 on board as a maintainer! 🥳
New Socials 🌐
We created the following social media presences for
Give us a follow for the latest
ratatui news & other cool stuff!
GitHub Sponsors 💖
We have enabled GitHub Sponsors for our organization: https://github.com/sponsors/ratatui-org
Our mission is to empower developers to create more interactive and visually rich command-line terminal user interfaces (TUIs). By sponsoring Ratatui, you’re not just funding a project; you’re helping make the ecosystem of terminal applications in Rust better.