ratatui supports a new backend called
termwiz which is a “Terminal Wizardry” crate that powers
To use it, enable the
termwiz feature in
Then you can utilize
TermwizBackend object for creating a terminal. Here is a simple program that
shows a text on the screen for 5 seconds using
New widget: Calendar
A calendar widget has been added which was originally a part of the extra-widgets repository.
Since this new widget depends on
time crate, we gated it behind
widget-calendar feature to avoid
an extra dependency:
Here is the example usage:
New widget: Circle
Circle widget has been added with the use-case of showing an accuracy radius on the world map.
Here is an example of how to use it with
This was a highly requested feature and the original implementation was done by @fdehau himself. Folks at Atuin completed the implementation and we are happy to finally have this incorporated in the new release!
An inline viewport refers to a rectangular section of the terminal window that is set aside for displaying content.
In the repository, there is an example that simulates downloading multiple files in parallel: https://github.com/ratatui-org/ratatui/blob/main/examples/inline.rs
Block: title on bottom
Before you could only put the title on the top row of a Block. Now you can put it on the bottom row! Revolutionary.
For example, place the title on the bottom and center:
Block: support adding padding
If we want to render a widget inside a
Block with a certain distance from its borders, we need to
Layout element based on the outer
Block, add a margin and render the
into it. Adding a padding property on the block element skips the creation of this second Layout.
This property works especially when rendering texts, as we can just create a block with padding and use it as the text wrapper:
Rendering another widget should be easy too, using the
Text: display secure data
A new type called
Masked is added for text-related types for masking data with a mask character.
The example usage is as follows:
border! macro has been added that takes
ALL and returns
border!() call returns
This is gated behind a
macros feature flag to ensure short build times. To enable it, update
Cargo.toml as follows:
Going forward, we will most likely put the new macros behind
macros feature as well.
Color: support conversion from
Have you ever needed this conversion?
Don’t worry, we got you covered:
Line is a significantly better name over
Spans as the plural causes confusion and the type
really is a representation of a line of text made up of spans.
Spans is renamed as
Line and a deprecation notice has been added.
See https://github.com/ratatui-org/ratatui/pull/178 for more discussion.
Listnow has a
len()method for returning the number of items
Sparklinenow has a
direction()method for specifying the render direction (left to right / right to left)
Liststates now have
- Expose the test buffer (
Here is the list of applications that has been added:
- oxycards: quiz card application built within the terminal.
- twitch-tui: twitch chat in the terminal.
- tenere: TUI interface for LLMs.
Also, we moved
APPS.md file to the
Wiki so check it out for more
applications built with
We put together a migration guide at the Wiki: Migrating from TUI
Also, the minimum supported Rust version is
Any contribution is highly appreciated! There are contribution guidelines for getting started.
Feel free to submit issues and throw in ideas!
If you are having a problem with
ratatui or want to contribute to the project or just want to
chit-chat, feel free to join our Discord server!