NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #1927 most downloaded on crates.io
A collection of Ratatui widgets for building terminal user interfaces using Ratatui.
Latest stable
0.3.2
Last release 5 months ago
19 Jun 2026
Release timing varies
gaps range from 2 weeks to 5 months
Some releases are documented
notes for 6 of 18 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
26 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
⚠️ List of breaking changes can be found here.
We are excited to announce the new version of ratatui - a Rust library that's all about cooking up TUIs 👨🍳🐀
✨ Release highlights: https://ratatui.rs/highlights/v0302/
⚠️ List of breaking changes can be found here.
90639c1 (uncategorized) Add Termina backend by @joshka in #2561
Summary
- add the
ratatui-terminabackend crate using the publishedterminacrate- expose the backend through the
terminafeature and Ratatui prelude/backend re-exports- add a small Termina event-loop example and wire the backend into CI, xtask, README generation, and docs
Refs #1784
Validation
cargo +nightly fmtcargo check -p ratatui-termina --all-features --all-targetscargo check -p ratatui --no-default-features --features terminacargo check -p xtaskcargo check -p release-headercargo xtask check-backend terminacargo xtask test-backend terminacargo xtask rdme --checkmarkdownlint-cli2 ARCHITECTURE.md ratatui-termina/README.md .github/ISSUE_TEMPLATE/bug_report.md
fce3c80 (widgets) Require thread-safe shadow effects by @joshka in #2584
Summary
- require custom shadow effects to preserve the auto traits expected by Block-backed widgets
- document the CellEffect auto-trait contract
- add a public widget regression test for the affected ratatui::widgets re-exports
Fixes #2583
e306ce6 (buffer) Create updates for "uncovered" cells by @benjajaja in #2587
When a wide cell from the previous buffer is replaced by a short/normal cell, the trailing cell does not get an update if its content does not change. But if the wide cell has a background (or other) style, the terminal did render the trailing cell with that style.
Force trailing cells to update if background, underline, or modifiers are different than the wide cell. We can ignore foreground.
Fixes #2585 (see that for the detailed visual reports)
81e667f (scrollbar) Keep a large thumb within the track at the end by @satyakwok in #2594
Closes #2582.
Problem
When the content is shorter than the viewport, the thumb is large relative to the track. With the position at the end,
part_lengthsclampedthumb_starttotrack_length - 1whilethumb_lengthwas clamped independently to[1, track_length], sothumb_start + thumb_lengthcould exceedtrack_length.
bar_symbolslays outbegin + track_start + thumb + track_end + endand zips it against the cells of the area. When the thumb overruns the track,track_endsaturates to0but the thumb still emits more cells than the track can hold, so the trailingendsymbol is pushed past the end of the area. The last visible cell ends up being a thumb (█) where the end arrow (▼) should be.Concretely, for the issue's repro (
VerticalRight,content_length = 9,position = 8, height24): track is22,thumb_length = 17,thumb_start = 6, and6 + 17 = 23 > 22.This is a regression from v0.30.0, where
thumb_lengthwas derived asthumb_end - thumb_startand therefore always fit within the track.Fix
Clamp
thumb_starttotrack_length - thumb_length(instead oftrack_length - 1) so the thumb always fits within the track and the end symbol is preserved.Test
Two regression tests, both fail on
mainand pass with the fix:
thumb_stays_within_track_for_large_thumb_at_endcheckspart_lengthsdirectly with the issue's parameters — assertsthumb_start + thumb_length <= track_lengthand that the parts sum to the track length.render_scrollbar_keeps_end_symbol_for_large_thumbrenders the #2582 case (both arrows, large thumb at the end) and asserts the end symbol is drawn rather than overwritten by a thumb cell.All existing scrollbar tests still pass.
c75d778 (ci) Add cargo-udeps dependency check by @joshka in #2599
Adds cargo xtask udeps and runs it from CI as a required job.
This complements cargo-machete rather than replacing it. cargo-machete is a fast static source scan, which is why it missed the package-level unused deps fixed in #2598 when the same dependency names were still referenced by example crates. cargo-udeps compiles the workspace and checks rustc dep-info, so it can catch unused dependency declarations for the package being checked.
To make the new job pass, this also removes the remaining true-positive unused dev-deps and records explicit cargo-udeps ignores for current false positives / intentional cases: ratatui-core critical-section, ratatui-crossterm's duplicate crossterm version feature shape, and ratatui-termwiz's doc-example-only ratatui dev-dependency.
I searched existing issues and PRs for udeps / cargo-udeps / "cargo udeps". I did not find prior ratatui discussion about adopting cargo-udeps; the only hits were Dependabot PR bodies for taiki-e/install-action release notes mentioning cargo-udeps version updates, for example #1971, #2095, #2194, and #2522.
Validation:- cargo xtask udeps
- cargo xtask format --check
4a63d41 (uncategorized) Remove unused dependencies by @KikiKian in #2598
Audit removes these dependencies that are not used:
ratatui/Cargo.toml — Removed from [dev-dependencies]:
- futures
- rand_chacha
- tokio
- tracing
- tracing-appender
- tracing-subscriber
ratatui-core/Cargo.toml — Moved from [dependencies] → [dev-dependencies]:
- indoc
36854ef (uncategorized) Add auto-merge required gate by @joshka in #2596
Summary
This makes GitHub auto-merge usable for Ratatui PRs once maintainers are happy with the change but CI is still running.
The workflow change adds a single aggregate
requiredjob to the main CI workflow. The repository now has auto-merge enabled and anensure checks passruleset that requires thatrequiredstatus context onmain.Why
Without a required status context, GitHub's auto-merge button is not useful for the maintainer flow we want. The goal is to let a maintainer review a PR, decide it is ready, click auto-merge, and move on without coming back later just to check whether the remaining jobs finished.
This does not relax the merge policy. GitHub's own auto-merge behavior is to merge only after all required reviews and required status checks are satisfied. This change gives GitHub a stable required status to wait on automatically.
Precedent
I have been using this same auto-merge pattern in
ratatui/tui-widgets, where it has worked well for the intended maintainer flow: once a PR looks ready, I can enable auto-merge and let GitHub merge it after the remaining checks and review requirements are satisfied.How it works
The new
requiredjob depends on the main CI jobs in.github/workflows/ci.ymland always runs after them. It fails if any required dependency fails, is cancelled, or is skipped.The repository ruleset requires only this aggregate
requiredcontext instead of requiring every individual matrix job separately. That gives GitHub one stable status to wait on while preserving the existing CI coverage.Things to know
- Auto-merge is opt-in per PR. Maintainers still choose when to click it.
- It does not skip review requirements, status checks, labels, or any other protection rule.
- A PR with auto-merge enabled can still show as blocked while checks or required reviews are pending. That is expected.
- If something needs to merge normally, maintainers can still use the regular merge path or an allowed ruleset bypass. This is a convenience path, not a hard blocker.
- Existing open PRs may need a rebase or synchronize event after this lands so they pick up the new
requiredworkflow job.- If a new required CI job is added later, it should be added to the
required.needslist or it will not be represented by the aggregate gate.- Jobs that are intentionally allowed to fail should be handled carefully before adding them to
required.needs, because skipped, cancelled, and failed dependencies make the aggregate fail.Current PR state
Auto-merge is already enabled on this PR. If you approve it and the required checks pass, GitHub will squash-merge it automatically; approving it is enough to let the PR merge once the remaining requirements are satisfied.
GitHub docs
- Automatically merging a pull request
- Managing auto-merge for pull requests in your repository
- About rulesets
- Require status checks to pass before merging
- About status checks
- Troubleshooting required status checks
Validation
ruby -e 'require "yaml"; YAML.load_file(".github/workflows/ci.yml"); puts "ok"'actionlint .github/workflows/ci.yml- Verified
ratatui/ratatuihasallow_auto_merge: true- Verified the active
ensure checks passruleset requires status contextrequired- Verified this PR has squash auto-merge enabled and is blocked pending checks/review
Full Changelog: https://github.com/ratatui/ratatui/compare/ratatui-v0.30.1...ratatui-v0.30.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
⚠️ List of breaking changes can be found here.
"Rats, we're rats; we're the rats." – Rat Movie
We are excited to announce the new version of ratatui - a Rust library that's all about cooking up TUIs 👨🍳🐀
✨ Release highlights: https://ratatui.rs/highlights/v0301/
⚠️ List of breaking changes can be found here.
74d6a84 (block) Support shadows by orhun in #2481
Introduce
Block::shadow(...)with a newShadowtype that supports:
- presets:
overlay,block,light_shade,medium_shade,dark_shade- custom symbols via
Shadow::symbol(...)- custom effects via
Shadow::custom(...)use ratatui::layout::Offset; use ratatui::style::Stylize; use ratatui::widgets::{Block, Shadow}; let popup = Block::bordered().title("Popup").shadow( Shadow::dark_shade() .black() .on_white() .offset(Offset::new(2, 1)), );Results in:
┌Popup─────┐ │content │▒ └──────────┘▒ ▒▒▒▒▒▒▒▒▒▒▒fixes #1892
4d30420 (buffer) Add CellDiffOption::AlwaysUpdate to force cell updates by sxyazi in #2480
When this option is used, the cells are updated even when content is identical.
Follow-up for https://github.com/ratatui/ratatui/pull/1605
Trying to resolve https://github.com/ratatui/ratatui/issues/1116
39c32c6 (buffer) Add cell diff options by benjajaja in #1605
Problem:Escape sequences always cause a cell to count as "multiwidth", even when it doesn't render wider than one cell, or not as wide as the escape sequence would be computed as.
Solution:Convert
skip:boolto enum. Add enum optionForceWidthto force a cell width for diffing.When using the option, this also fixes some bug where diffing is not idempotent and causes a diff operation for
(symbol.len() - 1)times.There are three new specific test cases:
- Rendering hyperlinks by squeezing the escape sequence into the first cell and forcing the width to the unicode width of the text part. This is much easier to implement for a Link widget, as it would only need to get the unicode-width once and not iterate over graphemes like Spans must do.
- Rendering hyperlinks by squeezing the opening sequence into the first cell with the first grapheme and forcing the width to that of the first grapheme. Then rendering each grapheme as usual. Then squeezing the closing sequence into the last cell with the last grapheme and forcing the width to that of the last grapheme. This is harder to implement for a Link widget, as it would have to iterate over graphemes with their width like Spans do.
- Kitty image sequence with utf-8 placeholders, similar to 2 but with known constant grapheme widths.
Link widget that leverages this
https://github.com/benjajaja/tui-link
It would be cooler if we could just add something like
.link(url)toSpans, because it would much simpler to insert some link and leverage all the Line/Text/Paragraph wrapping and whatnot. With a custom widget you need to take care of theAreawhere you'd want to render it, so it's not that clean. But we could iterate on this later, if even possible.
6faaddb (core) Implement from slice for line and text by NoOPeEKS in #2371
This PR adds the following implementations of the From trait for Line and Text structs:
- Implements From<&[T]> where T is Into<Span> for Line, allowing using of slices to construct Lines.
- Implements From<&[T]> where T is Into<Line> for Text, allowing using of slices of various types to construct Texts.
closes #2279
5fc6ab8 (core) Support layout-cache in no_std environments by junkdog in #2399
this enables "layout-cache" for no_std builds; it's meant for embedded environments, where the layout engine otherwise consumes all CPU, capping the framerate at around ~10fps. the same app can refresh 300-500 times per second with layout cache enabled.
i had to add
layout-cache = ["dep:critical-section"]to all builds - it's pretty tiny and shouldn't leave a trace in std-builds. the alternative is to add an extra layer of features for layout-cache with std and no_std, but it pollutes the feature space.
ee4b7a9 (crossterm) Add the missing hidden modifier by sxyazi in #2413
Fixes https://github.com/sxyazi/yazi/issues/3724, see https://github.com/sxyazi/yazi/issues/3724#issuecomment-3970129744 for a reproducer.
This PR adds the missing
Modifier::HIDDENstyle and introduces aqueue_modifier_diffto testModifierDiff::queue().It also fixes a bug where
CrosstermAttribute::BoldandCrosstermAttribute::Dimwould be emitted twice when resetting intensity. For example:#[case(Modifier::DIM, Modifier::BOLD, &[CrosstermAttribute::NormalIntensity, CrosstermAttribute::Bold])]would become:
#[case(Modifier::DIM, Modifier::BOLD, &[CrosstermAttribute::NormalIntensity, CrosstermAttribute::Bold, CrosstermAttribute::Bold])]
9d9239a (examples) Add volatility-surface 3D visualization by floor-licker in #2322
A design demonstration of a 3D volatility surface rendering using Braille canvas with interactive rotation and zoom controls. I built this for myself for an app I'm currently building but just wanted to share it with the community as well to inspire more 3D perspective terminal widgets in the future.
Final Demo
Description
Adds a new example demonstrating 3D visualization techniques in the terminal. There aren't many examples showing how to represent 3D objects in 2D terminal space so my goal is just to demonstrate more advanced Canvas and Braille rendering techniques for 3D graphics. The example visualizes an implied volatility surface which is a common financial visualization using interactive rotation and zoom controls. You can run the interactive demo for yourself with
cargo run -p volatility-surfacehttps://github.com/user-attachments/assets/aa32a864-54a8-4c67-a3c9-432dd29373fd
<img width="659" height="432" alt="image"
src="https://github.com/user-attachments/assets/68698cb0-c5d5-4b41-a3c3-65ec8fff12f5" />
Technical Highlights
- Demonstrates how to implement perspective projection in a terminal
- Shows advanced use of
Canvaswidget withMarker::Braille- Example of smooth animation patterns and state management
- Self-contained with synthetic data generation (no external APIs)
ae975c7 (examples) Allow overlap spacing in explorer by joshka in #2316
Store spacing as i16 so negative values map to Spacing::Overlap, and show overlap in the axis label.
1e0ab0c (ratatui-crossterm) Add IntoCrossterm<ContentStyle> for Style by 0xferrous in #2323
101a63e (render) Add function for applying buffer by musjj in #2566
Add a public API for applying and flushing the terminal buffer.
A minimal usage will look something like this:
use ratatui::Terminal; use ratatui::backend::CrosstermBackend; use ratatui::buffer::Buffer; use ratatui::widgets::Widget; let backend = CrosstermBackend::new(io::stdout()); let mut terminal = Terminal::new(backend)?; terminal.autoresize()?; let mut custom_buffer = Buffer::default(); custom_buffer.resize(terminal.get_frame().area()); custom_buffer.reset(); "Hello World!".render(custom_buffer.area, &mut custom_buffer); terminal.current_buffer_mut().merge(&custom_buffer); terminal.apply_buffer()?;My primary motivation for this PR is to improve the ECS ergonomics in
bevy_ratatui. But this should be useful for anyone who wants to commit incremental writes to the buffer without having to do everything in one monolithicTerminal::drawclosure.
f9d066f (table) Let Cells span multiple columns by karkhaz in #2150
Add a 'column_span' field to table cells. The default value is 1; larger values will cause cells to span over multiple columns, being rendered over all columns plus the spaces between them.
Fixes #1568.
a5b08d6 (widgets) Add Fill widget by Metbcy in #2520
Adds a new
Fillwidget that paints every cell within its area with a single repeated symbol and style. Integrates withStylizeso the whole chain works as expected:use ratatui::widgets::{Fill, Widget}; use ratatui::style::Stylize; Fill::new("X").blue().bold().render(area, buf);Implements
Widget(for bothFilland&Fill) andStyled, accepts anything that converts into aCow<'a, str>, and degrades gracefully on empty / multi-grapheme symbols.
9094fd2 (widgets) Add line shape with filled area for Canvas and Chart by bananaofhappiness in #2426
This commit adds filled area-chart rendering for both
CanvasandChart.You can now render a line and fill the area between that line and a baseline Y value, which helps highlight magnitude/volume trends.
- In
Canvas, useFilledLine.- In
Chart, useGraphType::Areaand set the baseline viaDataset::fill_to_y(f64).The
f64baseline is now configured onDataset(not inGraphType), soGraphTypestays a simple enum variant.Under the hood, line rasterization in canvas was refactored to share a reusable Bresenham point iterator, and
FilledLinebuilds on that to paint vertical spans from each line point tofill_to_y.Some screenshots with and without this new type: <img width="1460" height="879" alt="изображение" src="https://github.com/user-attachments/assets/c7b534b1-2afb-49c7-9c56-178e6ba9e844" /> <img width="1460" height="881" alt="изображение" src="https://github.com/user-attachments/assets/53592e2c-ee89-4481-9099-be06480d305a" />
// In Canvas use ratatui::widgets::canvas::FilledLine; Canvas::default() .paint(|ctx| { ctx.draw(&FilledLine::new(0.0, 0.0, 10.0, 5.0, 0.0, Color::Red)); }); // In Chart let dataset = Dataset::default() .data(&data) .graph_type(GraphType::Area) .fill_to_y(0.0); // fill to y = 0 Chart::new(vec![dataset]);
0a87882 (uncategorized) Add impl From<u16> for Padding and Margin by JayanAXHF in #2438
556cc7b (uncategorized) Add comment for inner area to popup example by Its-Just-Nans in #2309
01a15f9 (uncategorized) Add AsRef impls for widget types by joshka in #2297
d12bb83 (barchart) Handle empty horizontal charts by fallintoplace in #2553
Fixes #2552
This makes the
BarChartconstructors ignore empty groups, matching the existing.data(...)builder behavior. Without this,
BarChart::horizontal(Vec::<Bar>::new())stores one empty group, proceeds into horizontal rendering, skips the bar loop, and then underflows when computing the group label row frombar_y - self.bar_gap.The fix normalizes constructor input through a shared
non_empty_groupshelper fornew,horizontal, andgrouped. Empty horizontal charts now render nothing instead of panicking, and constructor behavior is consistent with.data(...).
6396b1c (block) Saturate block edge arithmetic by joshka in #2488
Motivation
- Block border and title layout used unchecked
u16arithmetic in several places.- In debug builds that can panic on tiny or edge-case geometry; in release builds the same arithmetic wraps.
- The original report came from merge-border rendering on tiny areas, but the same pattern appeared in title layout and spacing helpers as well.
Description
- Use saturating arithmetic in
Block::inner,render_sides,render_corners,titles_area, andvertical_space.- Clamp rendered title widths to
u16for layout arithmetic.- Replace unchecked title-width accumulation and cursor-advance math with bounded arithmetic.
- Add debug-only regression tests covering empty areas, maximal padding, title-area edge cases, and very large title widths.
Testing
- Ran
cargo test -p ratatui-widgets block::tests.
9143b83 (buffer) Diff for trailing cells when only style changes by gcavelier in #2308
this PR closes #2307 by preventing unnecessary diff updates for trailing cells when only style changes.
This PR was generated by Claude, and validated by me.
Summary
This PR fixes a visual artifact bug where block borders would appear offset when rendered over a widget that had a foreground color style applied to the entire area.
The Fix
- if !next_trailing.skip && prev_trailing != next_trailing { + // Only emit update if the SYMBOL changed, not just the style. + // The style of hidden trailing cells is not visible, so style + // differences alone should not trigger updates that can cause + // cursor positioning issues on some terminals. + if !next_trailing.skip && prev_trailing.symbol() != next_trailing.symbol() {This aligns the code with the documented intent: only emit updates when the symbol (visible content) changes, not when only the style changes.
Changes
File Change ratatui-core/src/buffer/buffer.rs:526-530Compare only symbol, not full cell ratatui-core/src/buffer/buffer.rs:1376-1425Add regression test Test Added
#[test] fn diff_ignores_style_only_changes_in_trailing_cells() { // Verifies that trailing cells with same symbol but different style // do NOT generate diff updates }Why This Is Safe
- Trailing cells are hidden - they are visually covered by the wide character
- Style is invisible - the fg/bg color of a hidden cell has no visual effect
- Symbol changes still trigger updates - if the symbol changes (e.g., from
" "to"x"), the update is still emitted- Aligns with documented intent - the original comment says "non-blank content", not "different style"
Related
- The existing test
diff_clears_trailing_cell_for_wide_graphemeverifies that symbol changes DO trigger updates- This fix complements that behavior by ensuring style-only changes do NOT trigger updates
e6b71f2 (build) Correct rust-toolchain->rust-version on cargo-deny-action by sermuns in #2471
closes #2470
43bbaae (clippy) Fix beta clippy errors by Logan-Ruf in #2433
Noticed these errors on my other PR and figured I could just fix them real quick.
closes #2432
957fbb0 (core) Use correct width for halfwidth dakuten/handakuten by orhun in #2499
unicode-width reports U+FF9E/U+FF9F as zero-width, but terminals render them as 1 cell. Adjusts
CellWidthtrait accordingly for fixing this behavior.fixes #2188
d7646c7 (core) Avoid overflow in BufferDiff forced-width advance by joshka in #2487
Motivation
- Prevent arithmetic overflow when advancing
self.posforCellDiffOption::ForcedWidth(NonZeroU16)inratatui-core/src/buffer/diff.rs, which could panic in debug or wrap in release and cause an iterator hang/DoS.Description
- Replace the unchecked
self.pos += width.get().saturating_sub(1)with a saturating addition viaself.pos = self.pos.saturating_add(width.get().saturating_sub(1) as usize)to avoid overflow while preserving existing iterator semantics.Testing
- Ran
cargo test -p ratatui-core buffer::diff --liband the buffer diff tests completed successfully (10 passed, 0 failed).
77f8006 (core) Avoid cursor position queries during resize by orhun in #2485
Terminal::resize()now clears without callingget_cursor_position(), so that CPR (Cursor position report) calls does not interfere with stdin.Fixes #2483
18aa467 (examples) Make line-gauge example compatible with macos sequoia's terminal.app by lazo4 in #2474
Part of the fix for #1972
Summary
This fix makes the
line-gaugeexample compatible with the macos sequoia Terminal.app which doesn't support truecolor. It reuses theis_true_color_supportedintroduced in #2211 by ffex and uses a color theme instead of hardcoding the colors.Result on macos sequoia
Before: <img width="566" height="138" alt="Capture d’écran 2026-04-06 à 11 47 07" src="https://github.com/user-attachments/assets/1ea37832-8a07-40b0-b0ab-aa77476ef9eb" /> After: <img width="561" height="120" alt="Capture d’écran 2026-04-06 à 11 46 45" src="https://github.com/user-attachments/assets/4bd50bc1-68f9-4601-b361-f610abf8629d" />
Notes
This is my first open source contribution, thanks to @ffex for letting me help on this issue
ce2c228 (examples) Change flex example colors for MacOS default terminal by ffex in #2211
Part of the fix for #1972
Summary
This fix introduces a function to check if we are in a terminal without truecolor(24-bit) and changes the default colors to appear fine of the flex example.
Notes
The function "is_true_color_supported” is an old problem and there is no common way to determine if a terminal supports or not the truecolor.
This is the main reason why the function detects specifically the Terminal.app version before the Tahoe. If there are other known terminals with this problem, we can add it to this function.
ef72dba (examples) Fix import for widget examples by orhun in #2422
closes #2299
88441cf (terminal) Fix inline viewport resizing issues by clearing the screen by wyvernbw in #2355
adds a check to the autoresize function to clear the entire screen and move the inline viewport to the top when the window shrinks horizontally in order to avoid line wrapping issues.
Other libraries like ink purge the history as well, but the
backend::ClearTypetype does not support that. Without this if the user scrolls up they will see previous broken renders. This should work well with all terminal emulators and multiplexers.fixes #2086
91b6fb7 (tests) Use the correct type for the cell diff test by orhun in #2472
fixes the CI!
4493742 (widgets) Handle single y-axis label by fallintoplace in #2550
Fixes #2549.
This prevents
Chartfrom panicking when the Y axis is configured with exactly one label. The X-axis rendering path already skips label placement when fewer than two labels are provided; this applies the same guard to Y-axis labels before the spacing calculation divides bylabels_len - 1.This also updates the
Axis::labelsdocs so they describe the newbehavior:fewer than two labels are not rendered instead of causing a panic.
0bdebd6 (widgets) Prevent chart scaling overflow by fallintoplace in #2546
Summary
Fixes #2545.
This changes BarChart and Sparkline scaling to use a
u128intermediate before division, then caps the scaled ticks at the drawable area. That prevents debug-build panics and release-build wrapping when publicu64chart values are large.Validation
cargo test -p ratatui-widgets barchart::testscargo test -p ratatui-widgets sparkline::testscargo check -p ratatui-widgets --all-featurescargo clippy -p ratatui-widgets --all-targets --all-features -- -D warningscargo test -p ratatui-widgets
e27a22a (widgets) Inherit the text alignment for Paragraph by 7Bpencil in #2369
Paragraph didn't take into account alignment of the text it was created from:
let lines = vec![ Line::from("one"), Line::from("double"), Line::from("quadruple"), ]; let text = Text::from(lines).centered(); // used to be rendered left-aligned, now centered let paragraph = Paragraph::new(text).block(block);Now the Paragraph inherits the text alignment.
b5c0831 (widgets) Avoid panic if Clear area is outside of buffer by 7Bpencil in #2368
If Clear area is at least partially outside of buffer, panic "index outside of buffer" happens on Widget::render
<details>
<summary>Demo source code</summary>
use crossterm::event::{self, Event, KeyModifiers}; use ratatui::{ layout::Rect, text::Line, widgets::{Block, Borders, Clear, Paragraph}, DefaultTerminal, Frame, }; use std::iter; fn main() { ratatui::run(app); } fn app(terminal: &mut DefaultTerminal) { loop { if let Event::Key(key_event) = event::read().expect("failed to read event") { if key_event.kind.is_press() && key_event.modifiers.contains(KeyModifiers::CONTROL) && key_event.code.is_char('c') { break; } } terminal.draw(render).expect("failed to draw frame"); } } fn render(frame: &mut Frame) { { let width = frame.area().width; let area = Rect::new(0, 0, width, 10); let line = Line::from("W".repeat(area.width as usize)); let lines: Vec<Line> = iter::repeat_n(line, area.height as usize).collect(); frame.render_widget(Paragraph::new(lines), area); } { let area = Rect::new(50, 2, 20, 5); let block = Block::default() .title_top(Line::from("Popup-with-Clear").centered()) .borders(Borders::ALL); let lines = vec![ Line::from("one"), Line::from("double"), Line::from("quadruple"), ]; frame.render_widget(Clear, area); frame.render_widget(Paragraph::new(lines).block(block).centered(), area); } { let area = Rect::new(80, 2, 20, 5); let block = Block::default() .title_top(Line::from("Popup").centered()) .borders(Borders::ALL); let lines = vec![ Line::from("one"), Line::from("double"), Line::from("quadruple"), ]; frame.render_widget(Paragraph::new(lines).block(block).centered(), area); } }</details>
Before the fix:
https://github.com/user-attachments/assets/cebae1df-87b2-48ae-9456-7ad8cb72035c
After the fix:
https://github.com/user-attachments/assets/9e0170f3-9c71-4a28-96b3-3f4b7db8ed37
1ce29d6 (uncategorized) Decouple std from serde and palette features by december1981 in #2460
The std feature now passes through to the deps rather than requiring std to use serde / palette.
2a0b4b2 (uncategorized) Ensure consistent thumb size when scrolling by kdheepak in #2352
This PR removes the use of
f64for calculating scrollbar thumb size and uses integer rounding (rounding up instead of the default rounding down) instead. Using integer rounding seems to fix the problem of thumb size not being consistent.Fixes #2351
4986b28 (uncategorized) Allow ratatui-widgets to be used without default features by jakobhellermann in #2350
Previously, ratatui-widgets was always included with default features.
Additionally, the
stdfeature would always enable thetimecrate.Fixing this gets rid of a few crates:
deranged,num-conv,time-core,time.
720303e (uncategorized) Align clear() semantics with contract by joshka in #2320
d2b0ce1 (uncategorized) Fix the dependency on time by asomers in #2306
ratatui-widgets uses time's Month::length(), which requires time-0.3.37 or later.
d754c5e (app) Simplify render function in the scrollbar example by marianomarciello in #2388
Divide the render function into two functions for vertical and horizontal scroll.
629e4b2 (core) Reintroduce Cell::skip as a deprecated field by junkdog in #2437
as discussed in https://github.com/ratatui/ratatui/pull/1605#discussion_r2933338973 - this brings back
Cell::skipas a deprecated field in order to avoid breaking the API in a patch release. in terms of noise; the diff() is left pretty intact, but had to#[allow(deprecated)]in a couple of places.
Cell::skipvsCellDiffOption
CellDiffOption::ForcedWidthtakes precedence overCell::skip, and
CellDiffOption::skipis already skip - soCell::skipcan only override whenCellDiffOption::Noneis set. i believe this is the correct behavior, but probably good to have another pair of eyes on it. @benjajaja maybe has some input too.PartialEq and Hash for
Cell::skip
Cell::skipis part ofPartialEqandHashas normal fields. another option would be to treatCellDiffOption::Noneas
CellDiffOption::SkipwhenCell::skipis set, and only consider the effectiveCellDiffOptionfor the trait impls.
ca5c109 (core) Introduce CellWidth trait for cell width computation by junkdog in #2400
this PR introduces a
CellWidthtrait for calculating the cell width/span, implemented for&strandCell.The impl for
Cellrespects the newCellDiffOption::ForcedWidth. All width calculations are prefixed with a check if the symbol is ascii before callingsymbol.width(); this micro-optimization probably won't do much on computers, but it helps on embedded.As discussed recently in #1605, this also changes the `CellDiffOption::ForcedWidth(type) from NonZeroUsize to NonZeroU16.
9ac167d (style) Add descriptive panic for Color::Reset anstyle conversion by singhh-piyush in #2423
Color::Resethas no equivalent inanstyle::Color. Previously, convertingColor::Reset.into()fell through to the catch-all arm inFrom<Color> for anstyle::Color, which called
AnsiColor::try_from(color).unwrap()and panicked with the message:called Result::unwrap() on an Err value: Ansi.This replaces the opaque
unwrap()with an explicit, immediately understandable panic:"Color::Reset has no equivalent in anstyle".Fixes #2341
f093b02 (uncategorized) Satisfy beta Clippy buffer debug lint by joshka in #2562
Remove a redundant borrow in
Buffer'sDebugimplementation
f8b42ad (breaking-changes) Update header for 0.30.0 by orhun in #2295
e82b3b7 (buffer) Run the doctests for Buffer by orhun in #2319
addresses https://github.com/ratatui/ratatui/pull/2314#pullrequestreview-3621576941
the doctest was not running at all... (due to
fn foo)
d8c86c3 (canvas) Add usage example for Line widget by ramadhan-dev-bright in #2473
Added a doc-tested example for the Line struct in canvas to improve documentation and help new users understand how to render lines with color.
83c1579 (changelog) Fix doubled words in two entries by adv0r in #2578
Typo:
in in→inandand and→andinCHANGELOG.md
fff27e8 (contributing) Add packages needed to run xtasks by alabhyajindal in #2409
Fixes #2408
be718d0 (ratatui-core) Fix terminal rendering grammar by Zacxxx in #2555
095b47d (ratatui-crossterm) Fix doubled article in module docs by adv0r in #2564
Dear maintainer — AI-authored PR by Composer under @adv0r. Methodology + opt-out at tokens-for-good. A one-line "no thanks" → auto-apology + auto-close + permanent blacklist. Silent close treated the same. Your time matters more than this contribution.
Typo:
See the the [Examples]→See the [Examples]inratatui-crossterm/src/lib.rs.
160b177 (ratatui-termwiz) Fix doubled article in module docs by adv0r in #2565
Dear maintainer — AI-authored PR by Composer under @adv0r. Methodology + opt-out at tokens-for-good. A one-line "no thanks" → auto-apology + auto-close + permanent blacklist. Silent close treated the same. Your time matters more than this contribution.
Typo:
See the the [Examples]→See the [Examples]inratatui-termwiz/src/lib.rs.
8ce5513 (sparkline) Fix typo in doc comment by adv0r in #2554
e6529fd (terminal) Improve terminal and setup docs for app authors by joshka in #2461
Summary
This updates the terminal and setup docs to better match the rendering behavior Ratatui actually implements, while also making the docs.rs path clearer for application authors.
The main docs changes are split into two commits:
docs: align terminal docs with behavior
- align
Terminal, viewport, frame, and flush docs with the real render pipeline
- clarify the boundary between
Terminal::flushandBackend::flush- improve examples for fullscreen, inline, and fixed viewport usage
docs: improve terminal docs for app authors
- improve setup-path guidance across
ratatui,ratatui-core, and backend crates
- clarify viewport choice, escape hatches, and common edge cases
- reduce duplication so crate-level docs explain choices while method docs hold detailed contracts
A small follow-up also fixes the crate-doc heading hierarchy in
ratatui-coreandratatui-crosstermso the generated READMEs no longer needmarkdownlint-disable-next-line heading-incrementsuppressions.Verification
cargo test -p ratatui --doccargo test -p ratatui-core --doccargo test -p ratatui-crossterm --doccargo test -p ratatui-termion --doccargo test -p ratatui-termwiz --doccargo test --workspace --all-targets --no-runcargo doc -p ratatui --no-depscargo doc -p ratatui-core --no-depscargo xtask format --checkcargo xtask readme --checkNote:
cargo doc -p ratatui-core --no-depsstill reports pre-existing warnings outside this pass inlayoutandtextdocs. The terminal-doc warnings introduced during this work were fixed.
744dc36 (uncategorized) Remove duplicate word in color and backend module by lphuc2250gma in #2535
Two one-line typo fixes for duplicated "the" in doc-comments:
ratatui-core/src/style/color.rs— "/// the the older serialization implementation of Color are also able to be deserialized." → "...the older serialization..."ratatui-core/src/backend.rs— "//! See the the [Examples] directory for more examples." → "//! See the [Examples] directory for more examples."No code/behavior change.
3df8c20 (uncategorized) Ask issue authors about PR willingness by joshka in #2317
Add a contribution question to the bug report and feature request templates so maintainers know whether the reporter wants to work on a fix/PR or needs guidance.
53d925a (uncategorized) Add Documentation on the Map Projection / CRS by C-Loftus in #2324
64d964b (uncategorized) Update Terminal docs by joshka in #2312
Summary
- Improve
TerminalRustdocs to better explain typical app setup, the rendering pipeline, and how diff-based rendering works (including full redraw behavior on viewport size changes).- Clarify viewport concepts and behavior in
Viewport/Terminaldocs, with a more complete inline section (anchoring, scrolling, resize behavior).- Reorder
Terminal::draw/Terminal::try_drawcloser to constructors so the primary rendering entry points are easier to find.Notes
- Docs-only change; no public API or runtime behavior changes.
- No new tests in this PR.
Test Plan
cargo +nightly fmtcargo +nightly docs-rs -p ratatui-corecargo test -p ratatui-core --doc --features std
8d73d47 (uncategorized) Fix comment to reflect correct symbol in assertion by homebrewmellow in #2314
fbd5621 (uncategorized) Fix misspellings by cgzones in #2310
dcea52b (core) Eliminate per-frame Vec allocation in Terminal::flush by junkdog in #2416
what and how
this PR removes the
Vec<(u16, u16, &Cell)>allocation inTerminal::flushwhen callingBuffer::diff. a new method,Buffer::diff_iteris instead used byTerminal::flush.the existing diff implementation has moved to the
BufferDiffiterator.why (who cares?)
it's the mice. on embedded devices, allocating a short-lived, contiguous block of up to 40-50kb is problematic due to heap fragmentation in combination with tiny heaps. the requirements for a full refresh over 1200 terminal cells is 37.5kb+vec growth padding, but since we're dealing with a contiguous block of memory, the actual memory requirements are considerably higher, depending on user-land allocation patterns.
b696ea3 (core) Split Terminal into submodules and expand test coverage by joshka in #2315
- Split the
Terminalimplementation into focused submodules to improve readability and maintainability.- Add characterization tests covering
Terminalinitialization, buffer lifecycle, resizing and autoresize behavior, and rendering paths.- Add inline viewport tests for
compute_inline_sizeandinsert_beforein both fallback and scrolling-regions modes, including an end-to-enddraw -> insert_before -> draw scenarioscenario.- Extend
TestBackendcursor plumbing to support the new terminal tests and assert cursor/ behavior.
746e9c9 (build) Add symlinks from each crate dir to root LICENSE by martinvonz in #2370
AFAICT, each crate directory must have its own LICENSE file for it to become part of the published crate. This patch therefore adds LICENSE symlinks from each crate directory to the root LICENSE file. This matches what e.g. clap does (https://github.com/clap-rs/clap).
Since ratatui-macros/LICENSE already exists and with different copyright holders than in the root LICENSE file, I left it unchanged.
7b66bd4 (ci) Use latest released cargo-machete action by sermuns in #2469
b6dfafd (markdown) Fix linting issues reported by xtask lint by Logan-Ruf in #2435
fba4448 (ratatui) Unleash the rats v0.30.1
0b03fe4 (toml) Migrate from taplo to tombi by joshka in #2501
Summary
This migrates the repo's TOML tooling from Taplo to Tombi.
The main motivation is maintenance and installability:
- Ratatui previously used Taplo for TOML formatting.
- Taplo's maintenance future has been uncertain; see https://github.com/tamasfe/taplo/issues/715.
- Taplo's current release artifacts are not friendly to
cargo-binstall, which means some setups fall back to building from source.- That source-build path is awkward for CI and was also a blocker while exploring a future Docker/devcontainer setup because of image size and install cost.
Tombi is actively maintained, publishes prebuilt binaries, and has a VS Code extension that lets us keep editor behavior aligned with CI.
What Changed
Tooling and CI
- Replace
taplowithtombiincargo xtask format.- Use
tombi-toml/setup-tombiin the formatting CI job.- Replace
.taplo.tomlwithtombi.toml.Formatting policy
- Keep the existing 100-column TOML line width.
- Disable schema-driven top-level table ordering for
Cargo.toml.- Disable the corresponding
tables-out-of-orderlint forCargo.toml.Why disable Cargo schema ordering:
- Tombi can order keys and tables according to schema metadata; see https://tombi-toml.github.io/tombi/docs/comment-directive/tombi-value-directive/#format-rules-table-keys-order.
- The schema order moved sections like
[features]below dependency sections.- That made feature-gated behavior harder to scan.
- It also created noisy migration churn that was not central to the tool switch itself.
Why disable the Cargo lint warning:
- The VS Code warning came from Tombi's
tables-out-of-orderlint rather than from formatting.- Since we are intentionally preserving the existing Cargo manifest section order, we also disable that lint for
Cargo.tomlto keep diagnostics aligned with the formatter configuration.- Related docs: https://tombi-toml.github.io/tombi/docs/configuration/.
Installation note
- Tombi is better positioned for binary installs than Taplo today, but it is still not fully in the generic
cargo-binstall/taiki-e/install-actionpath.- Relevant upstream context:
- binary naming / generic installer compatibility: https://github.com/tombi-toml/tombi/issues/1164
- crates.io publishing for
cargo-binstallfallback: https://github.com/tombi-toml/tombi/issues/1686- earlier crates.io publishing discussion: https://github.com/tombi-toml/tombi/issues/632
- In practice, this still leaves some rough edges around the generic Rust installer path, but Tombi already has usable prebuilt binaries and an official installer action, which is a better place for Ratatui than Taplo's current install story.
- CI now uses
tombi-toml/setup-tombiwith a pinned version, which avoids the GitHub token path by not asking the action to resolvelatestat runtime.Docs and editor setup
- Update contributor docs to point to Tombi's repo, docs, and installation guide.
- Note that the repo previously used Taplo and link the upstream maintenance discussion at https://github.com/tamasfe/taplo/issues/715.
- Add VS Code extension recommendations for
rust-lang.rust-analyzerandtombi-toml.tombi.- Add committed VS Code workspace settings for shared repo defaults, mainly so the workspace can define formatter behavior that matches CI, including TOML formatter selection and nightly rustfmt args.
- Add a dedicated formatting section to
CONTRIBUTING.mdcovering Rust formatting, TOML formatting, nightlyrustfmt, and the VS Code workspace override workaround.Why Commit VS Code Settings
This PR adds committed VS Code workspace settings for shared repo defaults only.
The goal is to:
- recommend the expected extensions
- make local editor formatting behave more like CI
- avoid formatter drift between editor usage and the repo's checked-in tooling
This is not intended to standardize everyone's full editor setup.
Nightly rustfmt
The repo already uses unstable rustfmt options in
rustfmt.toml, so formatting Rust code withcargo xtask formatworks best with nightly Rust. This is already how CI behaves.The docs now call this out more clearly:
- install nightly if you want local formatting to match CI
- the reason is to pick up the unstable formatting options configured in
rustfmt.tomlFor contributors who cannot or do not want to install nightly, the docs also point to a workaround: use a personal VS Code workspace file with override settings instead of changing the tracked workspace config.
Notes From Implementation
- Tombi
v0.9.19added config support to disable schema-defined ordering per schema, which let us preserve existingCargo.tomlsection order cleanly.- The
tables-out-of-orderwarning seen in VS Code came from Tombi lint, not formatting, so that needed a separate config change.- After disabling Cargo section ordering, the remaining TOML churn was much smaller and mostly mechanical.
Files of Interest
.github/workflows/ci.ymlxtask/src/commands/format.rstombi.toml.vscode/settings.json.vscode/extensions.jsonCONTRIBUTING.mdVerification
cargo xtask format --checkcargo metadata --format-version 1markdownlint-cli2 CONTRIBUTING.md
ed46fef (uncategorized) Update versions
f30bab9 (uncategorized) Ignore licker as typo
c7746e9 (uncategorized) Bump MSRV to 1.88.0 by orhun in #2396
b0a7703 (uncategorized) Escape usernames in changelog with backticks by kdheepak in #2377
This PR escapes all github usernames in the CHANGELOG.md file by adding a backtick before and after the username.
e.g.:Before
1dc18bf (calendar) Add width and height functions by joshka in #2198After
1dc18bf (calendar) Add width and height functions by `@joshka` in #2198This change should prevent unnecessary tags in PRs and forks, at least until the next release is made with git cliff changes from release-plz
0031fc6 (uncategorized) Remove @ sign from github release and PR by kdheepak in #2353
Previous PR (https://github.com/ratatui/ratatui/pull/2336) didn't solve the problem, and everyone still seems to be getting notifications (e.g. https://github.com/ratatui/ratatui/pull/2348).
This PR removes the
@for GitHub usernames in the autogenerated PR body byrelease-plz.{{ changelog | replace(from=" by ", to=" by ") }}The motivation behind this is that GitHub mentions in PR descriptions trigger notifications for every contributor for every release because their username is part of the changelog.
With this change, in GitHub PR descriptions the changelog will change like so:
Before
1dc18bf (calendar) Add width and height functions by joshka in #2198After
1dc18bf (calendar) Add width and height functions by joshka in #2198
ab5ad3f (uncategorized) Escape username using backticks in changelog by kdheepak in #2336
The motivation behind this is that GitHub mentions in PR descriptions trigger notifications for every contributor for every release because their username is part of the changelog.
⚠️ List of breaking changes can be found here.
"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 👨🍳🐀
🌠 Added "no_std" support for embedded targets, modularized architecture, major widget & layout upgrades!
✨ Release highlights: https://ratatui.rs/highlights/v030/
⚠️ List of breaking changes can be found here.
90a77aa (direction) Add Direction::perpendicular(self) by @b-guild in #2197
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
BREAKING CHANGE:label and text_value now accept
Into<>types, which breaks type inference.- Bar::default().label("foo".into()); + Bar::default().label("foo");- Bar::default().text_value("bar".into()); + Bar::default().text_value("bar");
b76ad3b (bar) Impl Styled for Bar by @Emivvvvv in #1476
Related:https://github.com/ratatui/ratatui/issues/683
e15fefa (barchar) Add BarChart::grouped constructor by @joshka in #1513
Add a new constructor to the
BarChartwidget that allows creating a grouped barchart with multiple groups of bars.Also add a new constructor to the
BarGroupwidget that allows creating a group of bars with a label.
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
Adds constructor methods for BarChart, BarGroup, and Bar
1dc18bf (calendar) Add width and height functions by @joshka in #2198
Fixes https://github.com/ratatui/ratatui/issues/2016
f18bcbf (canvas) Add quadrant, sextant and octant markers by @sbarral in #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
Braillewas left as the default.BREAKING CHANGE:addition of new variants to
Markerand removal of no longer used constants inratatui::symbols::braille.
26b05de (chart) Render Braille over Blocks in Charts and Canvas by @j-g00da in #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 (core) Add a has_modifier() method to Style by @sxyazi in #2267
Resolves https://github.com/ratatui/ratatui/issues/2264
2d713d7 (crossterm) Allow multiple crossterm versions by @joshka in #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_28andcrossterm_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 (layout) Add Flex::SpaceEvenly by @kdheepak in #1952 [breaking]
Resolves https://github.com/ratatui/ratatui/issues/1951
BREAKING CHANGE:Old
Flex::SpaceAroundbehavior is available by using
Flex::SpaceEvenlyand new
Flex::SpaceAroundnow distributes space evenly around each element except the middle spacers are twice the size of first and last elementsWith this change, the following variants of
Flexare 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(previouslyFlex::SpaceAround): Distributes space evenly between items and edges.Flex::Legacy: Preserves legacy behavior, placing all excess space at the end.This aligns behavior of
Flexwith 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 (layout) Add Offset::new() constructor by @joshka in #1547
7ad9c29 (linegauge) Customized symbols by @sectore in #1601
With this PR any symbol (
&str) can be used to renderfilledandunfilledparts ofLineGaugenow. Before that change, onlysymbols::line::Setwas accepted.Note:New methods are introduced to define those symbols:
filled_symbolandunfilled_symbol. The methodline_setis still there, but marked asdeprecated.
92a19cb (list) Highlight symbol styling by @airblast-dev in #1595 [breaking]
Allow styling for
List's highlight symbolThis change makes it so anything that implements
Into<Line>can be used as a highlight symbol.BREAKING CHANGE:
List::highlight_symbolcan no longer be used in const contextBREAKING CHANGE:
List::highlight_symbolaccepted&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 (no_std) Portable-atomic integration for targets with no atomic types by @j-g00da in #2076
Improves compatibility with no-std targets that don't support atomic types.
We support three different scenarios depending on the target:
- Terminal applications and other std targets (e.g. espidf):
stdenabled,portable-atomicdisabled
- Embedded targets with atomic types, bare metal x86, etc.:
stddisabledportable-atomicdisabled
- Embedded targets without atomic types (e.g. single-core MCUs):
stddisabled,portable-atomicenabledTurning on
portable-atomictogether withstdwill fall back tostdatomic.
1399d95 (no_std) Make palette and serde features depends on std by @j-g00da in #1919
b32f781 (no_std) Make ratatui-macros no-std by @j-g00da in #1865
3e1c72f (no_std) Make ratatui compatible with #![no_std] by @j-g00da in #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 (no_std) Option to disable layout cache for no_std compatibility by @j-g00da in #1795 [breaking]
Resolves #1780
BREAKING CHANGE:Disabling
default-featureswill now disable layout cache, which can have a negative impact on performance.
Layout::init_cacheandLayout::DEFAULT_CACHE_SIZEare now only available iflayout-cachefeature is enabled.
09173d1 (no_std) Make TestBackend::Error Infallible by @j-g00da in #1823 [breaking]
BREAKING CHANGE:
TestBackendnow usescore::convert::Infalliblefor error handling instead ofstd::io::Error
007713e (no_std) Replace Backend's io::Error usages with associated Error type by @j-g00da in #1778 [breaking]
Resolves #1775
BREAKING CHANGE:Custom backends now have to implement
Backend::ErrorandBackend::clear_region. Additionally some genericBackendusage will have to explicitly set trait bounds forBackend::Error.
a42a17e (no_std) Make ratatui-widgets no_std by @j-g00da in #1779
Resolves #1776
5a232a3 (no_std) Remove redundant std usages in ratatui-widgets by @j-g00da in #1762
ebe10cd (no_std) Remove redundant std usages in ratatui-core by @j-g00da in #1753
Resolves https://github.com/ratatui/ratatui/issues/1751
08b08cc (rect) Centering by @janTatesa in #1814
Resolves #617
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #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.
let mut state = ScrollbarState::default(); state.next();This commit adds a new method "
current_position" (sincepositionis already taken by the fluent setter) for that purpose:let index = state.get_position(); // yaySee #1545 for the concrete usage of this.
4c3c054 (serde) Handle null modifiers in serde Style by @joshka in #2172
Allow
Style'sadd_modifierandsub_modifierfields to deserialize fromnull
b9da192 (serde) Derive Serialize/Deserialize for alignment enums by @j-g00da in #1957
Resolves #1954
89b7421 (serde) Derive Serialize/Deserialize for additional structs/enums by @aurreland in #1883
This PR adds
#[derive(Serialize, Deserialize)]to the following structs:
ConstraintDirectionSpacingLayoutAccentedPaletteNonAccentedPalettePalettePaddingBordersBorderTypeListDirectionScrollbarOrientationScrollDirectionRenderDirectionHighlightSpacingFixes #1877
03f3f6d (style) Allow add/sub modifiers to be omitted in Style serialization. by @rcorre in #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_modifierandsub_modifierare not specified. That means the following TOML config:[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 (symbols) Make Marker non-exhaustive by @j-g00da in #2236 [breaking]
This will allow us to add new markers without causing further breaking changes.
BREAKING CHANGE:
Markeris now non-exhaustive
985cd05 (symbols) Add dashed borders by @theotchlx in #1573
Adds several new border sets:
- ratatui::symbols::border::LIGHT_DOUBLE_DASHED
- ratatui::symbols::border::HEAVY_DOUBLE_DASHED
- ratatui::symbols::border::LIGHT_TRIPLE_DASHED
- ratatui::symbols::border::HEAVY_TRIPLE_DASHED
- ratatui::symbols::border::LIGHT_QUADRUPLE_DASHED
- ratatui::symbols::border::HEAVY_QUADRUPLE_DASHED
And corresponding variants to the ratatui::widgets::BorderType enum
Fixes:https://github.com/ratatui/ratatui/issues/1355
4c301e8 (text) Implement AddAssign for Text by @acuteenvy in #1956
This makes it possible to add a second
Textinstance to a first one using the += operator.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 (widgets) Add the missing constructor to canvas types by @orhun in #1538
Allows constructing
Rectangle,PointsandCircleusing thenewmethod instead of initializing with the public fields directly.
22610b0 (uncategorized) Support adding an Offset to Position by @joshka in #2239
Adds Position::offset() and arithmentic ops (Position + Offset and Position - Offset)
Fixes:https://github.com/ratatui/ratatui/issues/2018
24e3133 (uncategorized) Add Rect::resize() method by @joshka in #2240
Fixes:https://github.com/ratatui/ratatui/issues/1440
96d097e (uncategorized) Implement Rect ops for moving by @joshka in #1596
feat:implement Rect ops for moving
Implemented
Add,AddAssign,Sub, andSubAssignonRectforOffset. This makes it possible to move rectslet 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 (uncategorized) Add Size::area() by @joshka in #2226
Add Size::area() returning u32 to avoid u16 overflow Fixes https://github.com/ratatui/ratatui/issues/2204
b6588fd (uncategorized) Implement From<Size> for (u16, u16) by @0xb002f0 in #2223
75b78be (uncategorized) Add width() impl for tabs by @joshka in #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 (uncategorized) Implement UnicodeWidthStr for Text/Line/Span by @joshka in #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 (uncategorized) Add conversion from Size to Rect by @joshka in #2028
Rect::from(size)returns a new Rect at the origin (0, 0) with the specifiedSize
017af11 (uncategorized) Preserve block titles when merging borders by @j-g00da in #1977
Resolves #1939
6dcd53b (uncategorized) Add ergonomic methods for layouting Rects by @joshka in #1909
This commit introduces new methods for the
Rectstruct that simplify the process of splitting aRectinto sub-rects according to a givenLayout. By putting these methods on theRectstruct, we make it a bit more natural that a layout is applied to theRectitself, rather than passing aRectto theLayoutstruct to be split.Adds:-
Rect::layoutandRect::try_layoutmethods that allow splitting aRectinto an array of sub-rects according to a givenLayout.
Rect::layout_vecmethod that returns aVecof sub-rects.Layout::try_areasmethod that returns an array of sub-rects, with compile-time checks for the number of constraints. This is added mainly for consistency with the newRectmethods.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 (uncategorized) Add Rect::outer() by @joshka in #1929
Fixes:https://github.com/ratatui/ratatui/issues/211
7bc78bc (uncategorized) Add ratatui::run() method by @joshka in #1707
This introduces a new
ratatui::run()method which runs a closure with a terminal initialized with reasonable defaults for most applications. This callsratatui::init()before running the closure andratatui::restore()after the closure completes, and returns the result of the closure.A minimal hello world example using the new
ratatui::run()method: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:
fn run(terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } ratatui::run(run)?;struct App { ... } impl App { fn new() -> Self { ... } fn run(mut self, terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } } ratatui::run(|terminal| App::new().run(terminal))?;
b6fbfcd (uncategorized) Add lifetime to symbol sets by @joshka in #1935
This makes it possible to create symbol sets at runtime with non-static lifetimes.
Fixes:https://github.com/ratatui/ratatui/issues/1722
488e5f0 (uncategorized) Make border! work without importing Borders by @j-g00da in #1918
Currently using
border!macro requires explicit import ofBorderswhich is unnecessary.
671c2b4 (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 (uncategorized) Implement stylize methods directly on Style by @joshka in #1572 [breaking]
This makes it possible to create constants using the shorthand methods.
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:
Styleno longer implementsStyled. 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 existingreset()method. UseStyle::reset()rather thansome_style.reset()Fixes:#1158
4fcd238 (uncategorized) Support no-std for calendar widget by @joshka in #1852
Removes the CalendarEventStore::today() function in no-std environments
53cdbbc (uncategorized) Enable serde propagation to backend crates (crossterm, termion) by @ArjunKrish7356 in #1812
This PR propagates the serde feature from the main ratatui crate to the ratatui-crossterm and ratatui-termion backend crates. Solves #1805
6836a69 (uncategorized) Implement styled for other primitives by @aschey in #1684
fcb47d6 (uncategorized) Rename Alignment to HorizontalAlignment and add VerticalAlignment by @joshka in #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
Alignmentenum has been renamed toHorizontalAlignmentto 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.- use ratatui::layout::Alignment; + use ratatui::layout::HorizontalAlignment; - use Alignment::*; + use HorizontalAlignment::*;
2714d6b (uncategorized) Add array and tuple RGB color conversion methods by @joshka in #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::Rgbinstance. Any alpha value is ignored.Color::from([255, 0, 0]); Color::from((255, 0, 0)); Color::from([255, 0, 0, 255]); Color::from((255, 0, 0, 255));
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
Move the Mascot from Demo2 into a new widget. Make the Rat grey and adjust the other colors.
frame.render_widget(RatatuiMascot::default(), frame.area());
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #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.
a89d3d6 (buffer) Clear behavior with VS16 wide emojis by @nornagon in #2063
This fixes a bug where certain emojis like ⌨️ would sometimes be "overlaid" onto existing content from the buffer, instead of properly clearing.
This PR was generated by Codex, and validated by me:
- Behavior of the above example code was buggy before this fix (showed overlaying "b" on top of the keyboard emoji), and fixed after.
- 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 (canvas) Round coordinates to nearest grid cell by @joshka in #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 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #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 (ci) Add contents write permission to release-plz PR by @marcoieni in #2119
https://release-plz.dev/docs/github/quickstart#3-setup-the-workflow
Fixes https://github.com/release-plz/release-plz/issues/2439
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #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 (demo) Update the width of demo2 tape by @orhun in #2164
fixes #1721
dca331c (demo) Support tab key in demo2 example by @orhun in #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-destroymostly.
0fd4753 (examples) Run the correct example for chart by @orhun in #1679
fixes #1678
39479e2 (examples) Ensure that example projects are not published by @orhun in #1672
9314312 (layout) Feature flag cache related types by @joshka in #1842
2dd1977 (layout-cache) Import NonZeroUsize only when layout-cache is enabled by @j-g00da in #1839
This silences unused import warning, when
layout-cacheis disabled.
564a9d7 (line-gauge) Pad default label to display 3 numbers by @martinetd in #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 (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
The canvas map constants are now statics instead. Fixes https://rust-lang.github.io/rust-clippy/master/index.html#large_const_arrays
2e54d5e (macros) Use $crate re-export in text macro by @airblast-dev in #1832
79d5165 (no_std) Propagate std feature flag to dependencies by @j-g00da in #1838
Disables
stdfeature flags in dependencies and only enables them withratatuiandratatui-core'sstdfeature flag. This partially fixes the issue of still depending onstd, whenstdfeature flag is disabled.
00da8c6 (no_std) Provide f64 polyfills for no_std compatibility by @j-g00da in #1840
Related:https://github.com/rust-lang/rust/issues/137578
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
This adds the
area.is_empty()back into the scrollbar render method. Without it, the widget panics if the height is 0.
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
0a25bc1 (tests) Update the stderr snapshot for ratatui-macros by @orhun in #2161
New 🦀 broke the CI
5fa342c (widgets) Fix centered block title truncation by @ognis1205 in #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 (uncategorized) String_to_string lint is now part of implicit_clone by @joshka in #2173
1fe64de (uncategorized) Include underline color in anstyle conversion by @aschey in #2004
Underline color wasn't included in the style conversion logic.
c1b8528 (uncategorized) Panic when rendering widgets on too small buffer by @j-g00da in #1996
Fixes panic on overflow on horizontal
BarchartandRatatuiMascotand adds proper tests to all widgets.
08b21fa (uncategorized) Fix panic when rendering a Paragraph out of bounds by @jwodder in #1670
Fixes #1667.
80bc818 (uncategorized) Fix truncation of left aligned block titles by @joshka in #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 (uncategorized) Fix handling of multi-byte chars in bar chart by @joshka in #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 (uncategorized) Derive copy for list state by @janTatesa in #1921
12cb5a2 (uncategorized) Allow canvas area to exceed u16::MAX by @Daksh14 in #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 (uncategorized) Typo in changelog by @joshka in #1857
c238aca (uncategorized) padding_right() should set right padding instead of left by @sxyazi in #1837
Fixes https://github.com/ratatui/ratatui/issues/1836
c90ba97 (uncategorized) Avoid unnecessary imports in minimal build by @cgzones in #1787
core::ops::Range is only used with the feature
scrolling-regions. Ensure a minimalcargo checkreports no warnings.
416ebdf (uncategorized) Correct clippy errors introduced by rust 1.86.0 update by @j-g00da in #1755
New version of rust (1.86.0) caused CI to fail.
4eac5b2 (uncategorized) Make deprecation notes more helpful by @joshka in #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 usingBuffer::get(x, y)instead ofBuffer[(x, y)].
35a8642 (uncategorized) Rect::positions() should be empty when width is 0 and height is nonzero by @jwodder in #1669
Fixes #1666.
f5fc819 (uncategorized) Avoid extra line break on whitespace only lines when wrapping paragraphs by @dotdash in #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 (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #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.
8d60e96 (examples) Use crossterm event methods by @joshka in #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 (no_std) Make usages of std explicit in ratatui-core. by @ed-2100 in #1782
This commit does the following:
- Adds
#[no_std]tolib.rs.- Adds
extern crate std;tolib.rs.- Updates
ratatui-coreto explicitlyuseitems from std and alloc.- Prefers
use-ing alloc over std when possible.Explanation:
This allows usages of
stdinratatui-coreto be clearly pointed out and dealt with individually.Eventually, when
stdis to be feature gated, the associated commit will be much cleaner.
f132fa1 (table) Small readability improvements by @joshka in #1510
c7c3498 (uncategorized) Use saturating_add in Rect::new by @pharrison31415 in #2216
02e53de (uncategorized) Make use of iter::repeat_n() by @cgzones in #1788
Applied via clippy --fix. Available since 1.82.0.
a195d59 (uncategorized) Move xtask commands to small modules by @joshka in #1620
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
Backend code is now moved to
ratatui-crossterm,ratatui-termionandratatui-termwiz. This should be backwards compatible with existing code.
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
This is a preparatory refactoring for modularization. No user visible changes.
40e96a2 (block) Add collapsed border example by @joshka in #1899
d291042 (block) Revise the block example by @orhun in #1520
- Moves the block example from
ratatuitoratatui-widgets- Simplifies the example (bordered, styled, custom borders)
see #1512
0951da5 (breaking-changes) Improve migration guide for Backend::Error by @j-g00da in #1908
Related:https://github.com/fujiapple852/trippy/pull/1588
bbe1cf9 (breaking-changes) Change MSRV to 1.85 by @j-g00da in #1896
The minimum supported Rust version is now for
ratatuiv0.30 is 1.85
c7912f3 (breaking-changes) Fix header level by @j-g00da in #1825
73488ab (contributing) Fix link to widgets_block_renders test by @ognis1205 in #2101
The
CONTRIBUTING.mdreferencedtests/widgets_block.rs, but the correct path isratatui/tests/widgets_block.rs. Updated the link so that readers can navigate to the test example without 404 error.
1197b2a (contributing) Add note about using nightly for formatting by @joshka in #1816
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
- Updates
CONTRIBUTING.mdabout the usage ofxtask- Removes
Makefile.toml
22e3e84 (core) Remove link to Paragraph widget by @orhun in #1683
b65788c (examples) Remove duplicated link by @matthiasbeyer in #2212
200b217 (examples) Add VHS tapes and docs for widget examples by @orhun in #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 (examples) Fix a typo by @j-g00da in #1890
Makes CI typos check pass again
882cc3c (examples) Update app examples with tapes by @orhun in #1673
4393fae (examples) Move scrollbar example to examples folder by @orhun in #1665
9ea70e2 (examples) Move widget-impl example to examples folder by @orhun in #1663
774ab78 (examples) Move widget-ref-container example to examples folder by @orhun in #1664
see #1512
910d16e (examples) Move user-input example to examples folder by @orhun in #1659
dbfb7da (examples) Move table example to examples folder by @orhun in #1657
cb2a58a (examples) Move tracing example to examples folder by @orhun in #1658
7e00b64 (examples) Move panic example to examples folder by @orhun in #1655
8127590 (examples) Move modifiers example to examples folder by @orhun in #1654
7c40c0b (examples) Move popup example to examples folder by @orhun in #1656
see #1512
d87354f (examples) Move list example to examples folder by @orhun in #1653
see #1512
also renames it to todo-list
621226f (examples) Move inline example to examples folder by @orhun in #1651
9ba7d25 (examples) Move hyperlink example to examples folder by @orhun in #1650
bb94d1c (examples) Move minimal example to examples folder by @orhun in #1649
9f399ac (examples) Move gauge example to examples folder by @orhun in #1646
104d6a6 (examples) Move custom-widget example to examples folder by @orhun in #1644
fa8ca01 (examples) Move flex example to examples folder by @orhun in #1642
f5fde0e (examples) Move constraints example to examples folder by @orhun in #1641
fc70288 (examples) Move constraint-explorer example to examples folder by @orhun in #1640
325f961 (examples) Move hello-world example to examples folder by @orhun in #1647
867c4bc (examples) Move colors-rgb example to examples folder by @joshka in #1582
- docs: move colors-rgb example to examples folder
- docs: update main examples README
72334ed (layout) Update documentation to point to kasuari solver by @a-kenji in #2003
2be9ccb (layout) Remove unnecessary path prefix by @j-g00da in #1766
b669ceb (layout) Change cassowary to kasuari crate reference by @j-g00da in #1765
f907c74 (license) Update copyright years by @LVivona in #1639
Update MIT Licence to copyright year 2025
68b9f67 (readme) Add Built with Ratatui badge for downstream projects by @harilvfs in #1905
6e43672 (readme) Reimagine README.md by @orhun in #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 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
8e5151f (rect) Fix typo in the Rect::outer function comments by @orhun in #2123
40f13c6 (rect) Update the outdated comment for Rect::area() by @isgin01 in #2100
The return value of Rect.area() is no longer of u16 type, and the value is not being clumped anymore.
9a930a6 (terminal) Made usage of Terminal::get_frame() clearer by @Blaeriz in #2071
Closes : https://github.com/ratatui/ratatui/issues/1200
b08b4cb (terminal) Add disclaimer about panics to Terminal::new by @lolbinarycat in #2088
part of #2087
cc @orhun
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
related #1512
ed5dd73 (widgets) Add example for tabs by @orhun in #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 (widgets) Add example for scrollbar by @orhun in #1545
Related to: #1512
898aef6 (widgets) Add example for list by @orhun in #1542
Related to: #1512
452366a (widgets) Add example for sparkline by @orhun in #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 (widgets) Add example for table by @orhun in #1557
related #1512
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
better stonks
15f442a (widgets) Add example for paragraph by @orhun in #1544
related #1512
Also removes the paragraph example from
ratatuisince these examples are more or less the same.
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
related #1512
Also updates the code to make it consistent with the other examples
f2451e7 (widgets) Add example for gauge by @orhun in #1539
related #1512
4f0a8b2 (widgets) Add example for canvas by @orhun in #1533
related #1512
91147c4 (widgets) Add example for chart by @orhun in #1536
stonks
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
related #1512
99ac005 (widgets) Add simple barchart example by @joshka in #1511
b1d47e7 (uncategorized) Discourage use of Buffer's pos_of, index_of by @pharrison31415 in #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 (uncategorized) Fix: fix typos by @j-g00da in #2129
This fixes the pipeline after bumping typos.
9998000 (uncategorized) Use shields.io badge by @LitoMore in #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 :v:
And it's customizable. There are more configurations at https://shields.io/badges.
Here are some examples:
    
I also created a PR to the ratatui-website project to update the badge. Here is the PR:
- https://github.com/ratatui/ratatui-website/pull/924
71ef65b (uncategorized) Add section on collaborative development to contributing doc by @joshka in #2029
cba5cca (uncategorized) Update heading image for Ratatui 0.30.0 release 🎉 by @j-g00da in #2000
9836f07 (uncategorized) Add AI contribution guidelines by @joshka in #2013
98f85b8 (uncategorized) Update link to scrollable widgets RFC by @MatrixFrog in #1994
055522e (uncategorized) Add docs for authoring widget crates by @j-g00da in #1955
- added Authoring Widget Libraries sub-section
- moved built-in and third-party widgets sections higher
617d318 (uncategorized) Improve Block docs by @joshka in #1953
8e2d568 (uncategorized) Improve layout related docs by @joshka in #1948
Adds module level docs and more comprehensive docs on all the types in the layout module
Fixes #1937
4c708dd (uncategorized) Improve docs for run/init/restore etc. by @joshka in #1947
- docs: document the init module
- docs: use the ratatui::run() methods in the main doc
- docs: add more intradoc / website links and historical perspective on Terminal / backend
- docs: add notes about new run/init/restore methods and the defaultterminal type to terminal docs
5620e06 (uncategorized) Add crate organization sections to workspace by @joshka in #1946
Adds summary-level crate organization documentation to all crates explaining the modular workspace structure and when to use each crate. Links to ARCHITECTURE.md for detailed information.
cfb65e6 (uncategorized) Add examples for handling state by @joshka in #1849
Added comprehensive state management examples covering both immutable and mutable patterns and documentation to help developers choose the right approach for their applications.
3de41a8 (uncategorized) Document widgets module by @joshka in #1932
Adds a good overview of the use and implementation of widget traits.
Goals with the doc rewrite:
- document the rationale for the ratatui-widgets crate with info for app builders and widget makers.
- Show how to use the widgets for rendering as well as implement the traits- document the differences and reasons for each trait
- document the historical perspective (to make it easy to understand older Ratatui apps as well as migrate to newer approaches
- give recommended approaches to implementing traits
- explain the differences between Consuming and Shared / Mutable Reference implementations of Widget
- explain the differences between using StatefulWidget and Mutable References
- Explain the use case for WidgetRef and StatefulWidgetRef
- Link out to third part widget lists
Fixes:https://github.com/ratatui/ratatui/issues/366
ca2ad4a (uncategorized) Simplify ratatui-macro docs by @joshka in #1923
92b6a16 (uncategorized) Fix grammar in ratatui-widgets README by @sevki in #1885
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
Implements ideas alluded to by https://discord.com/channels/1070692720437383208/1072907135664529508/1323061053990637640 and followup conversations.
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
Fix wording in
user_input.rsexample.
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
Fix end of sentence punctuation in canvas.rs docs.
e411d9e (uncategorized) Add input form example by @joshka in #1551
Demonstrates how to manage the cursor and input focus with a simple form. Uses an enum to track the current input field and passes the input events to the active field.
This is similar to the json tutorial on the website, but a bit simpler
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
Demonstrates how to handle mouse events
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
Overall makes improvements in the documentation of the workspace crates and checking them.
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
1f41a61 (paragraph) Avoid unnecessary work when rendering by @alexpasmantier in #1622
Improve render times for paragraphs that are scrolled.
Currently all
LineComposers are considered to be state machines which means rendering a paragraph with a given Y offset requires computing the entire state up to Y before being able to render from Y onwards.While this makes sense for Composers such as the
WordWrapper(where one needs to consider all previous lines to determine where a given line will end up), it means it also penalizes Composers which can render a given line "statelessely" (such as theLineTruncator) which actually end up doing a lot of unnecessary work (and on the critical rendering path) when the offset gets high.
ba9eed7 (table) Replace while loop with simple min operation by @EdJoPaTo in #1747
345f47e (rect) Use plus operator for offset by @pharrison31415 in #2251
Summary
Use
+operator to moveRectby anOffsetas added here.Includes change to use
Offset::new()in place ofOffset { ... }
ac60de3 (uncategorized) Fix wrapping in doc comment by @joshka in #2104
2739391 (uncategorized) Use Module imports_granularity by @joshka in #1728
I was swayed by the arguments about this made by the compiler team In https://github.com/rust-lang/compiler-team/issues/750 and decided to look at how this organization affects ratatui. I found this reduces the number of lines across the codebase by about 350 and makes the imports more readable and definitely more greppable as you usually only have to read a single line. I've found in the past that maintaining imports regularly leads to merge conflicts which have to be resolved by hand and this change should reduce the likelihood of that happening.
Main change is in rustfmt.toml, and the rest is just the result of running
cargo xtask format.While implementing this, cargo machete brings up that the various backend crates are unused by the example crates.
The re-export of each backend crate under ratatui is to make it possible for libs that rely on a specific version of ratatui to use the same version of the backend crate. Apps in general should use the backend crate directly rather than through ratatui as this is less confusing.
- Removes all usages of `ratatui::{crossterm, termion, termwiz}`` in the examples.
- Adds the backend crate to the dependencies of the examples that use the backend crate directly.
db65aa0 (bench) Add benchmark for text by @orhun in #2160
#2138
a21501f (bench) Added a benchmark for constraints by @kashregister in #2043
I've added a new benchmark for constraints, which only takes into account the time it takes to generate a full layout using a single type of constraints only. Avoided rendering here as it resulted in more inaccurate benchmarks, and i believe it should be separated nonetheless.
94ba82e (gauge) Add benchmarks for gauge by @WaterWhisperer in #2221
39cd313 (layout) Add visual buffer tests for Rect methods by @orhun in #2124
8aefc06 (macros) Regenerate trybuild stderr by @ognis1205 in #2093
Overview
Updated the
.stderrfile corresponding to theratatui-macros/tests/ui/fails.rscompile-fail test.Changes
- Updated
tests/ui/fails.stderrto match the new compiler output.Impact
- Affects only the trybuild UI tests
- No impact on production code
Notes
- The
.stderrwas generated usingTRYBUILD=overwrite cargo test.Closes https://github.com/ratatui/ratatui/issues/2094
55a95e6 (rect) Mutual intersection agreement by @pharrison31415 in #2252
deb1b8e (uncategorized) Ensure Style::new() and Style::default() are equivalent by @cgzones in #1789
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
Adds two traits
IntoCrosstermandFromCrosstermfor converting between ratatui and crossterm types. This is necessary in order to avoid the orphan rule when implementingFromfor crossterm types once the crossterm types are moved to a separate crate.Similarly Termwiz and Termwiz gain FromTermion, IntoTermion, FromTermwiz and IntoTermwiz traits.
BREAKING CHANGE:The
FromandIntoimpls for backend types are now replaced with specific backend traits.+ use ratatui::backend::{FromCrossterm, IntoCrossterm}; let crossterm_color = crossterm::style::Color::Black; - let ratatui_color = crossterm_color.into(); - let ratatui_color = ratatui::style::Color::from(crossterm_color); + let ratatui_color = ratatui::style::Color::from_crossterm(crossterm_color); - let crossterm_color = ratatui_color.into(); - let crossterm_color = crossterm::style::Color::from(ratatui_color); + let crossterm_color = ratatui_color.into_crossterm(); let
Note truncated.
⚠️ List of breaking changes can be found here.
"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.
90a77aa (direction) Add Direction::perpendicular(self) by @b-guild in #2197
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
BREAKING CHANGE:label and text_value now accept
Into<>types, which breaks type inference.- Bar::default().label("foo".into()); + Bar::default().label("foo");- Bar::default().text_value("bar".into()); + Bar::default().text_value("bar");
b76ad3b (bar) Impl Styled for Bar by @Emivvvvv in #1476
Related:https://github.com/ratatui/ratatui/issues/683
e15fefa (barchar) Add BarChart::grouped constructor by @joshka in #1513
Add a new constructor to the
BarChartwidget that allows creating a grouped barchart with multiple groups of bars.Also add a new constructor to the
BarGroupwidget that allows creating a group of bars with a label.
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
Adds constructor methods for BarChart, BarGroup, and Bar
1dc18bf (calendar) Add width and height functions by @joshka in #2198
Fixes https://github.com/ratatui/ratatui/issues/2016
f18bcbf (canvas) Add quadrant, sextant and octant markers by @sbarral in #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
Braillewas left as the default.BREAKING CHANGE:addition of new variants to
Markerand removal of no longer used constants inratatui::symbols::braille.
26b05de (chart) Render Braille over Blocks in Charts and Canvas by @j-g00da in #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 (core) Add a has_modifier() method to Style by @sxyazi in #2267
Resolves https://github.com/ratatui/ratatui/issues/2264
2d713d7 (crossterm) Allow multiple crossterm versions by @joshka in #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_28andcrossterm_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 (layout) Add Flex::SpaceEvenly by @kdheepak in #1952 [breaking]
Resolves https://github.com/ratatui/ratatui/issues/1951
BREAKING CHANGE:Old
Flex::SpaceAroundbehavior is available by using
Flex::SpaceEvenlyand new
Flex::SpaceAroundnow distributes space evenly around each element except the middle spacers are twice the size of first and last elementsWith this change, the following variants of
Flexare 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(previouslyFlex::SpaceAround): Distributes space evenly between items and edges.Flex::Legacy: Preserves legacy behavior, placing all excess space at the end.This aligns behavior of
Flexwith 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 (layout) Add Offset::new() constructor by @joshka in #1547
7ad9c29 (linegauge) Customized symbols by @sectore in #1601
With this PR any symbol (
&str) can be used to renderfilledandunfilledparts ofLineGaugenow. Before that change, onlysymbols::line::Setwas accepted.Note:New methods are introduced to define those symbols:
filled_symbolandunfilled_symbol. The methodline_setis still there, but marked asdeprecated.
92a19cb (list) Highlight symbol styling by @airblast-dev in #1595 [breaking]
Allow styling for
List's highlight symbolThis change makes it so anything that implements
Into<Line>can be used as a highlight symbol.BREAKING CHANGE:
List::highlight_symbolcan no longer be used in const contextBREAKING CHANGE:
List::highlight_symbolaccepted&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 (no_std) Portable-atomic integration for targets with no atomic types by @j-g00da in #2076
Improves compatibility with no-std targets that don't support atomic types.
We support three different scenarios depending on the target:
- Terminal applications and other std targets (e.g. espidf):
stdenabled,portable-atomicdisabled
- Embedded targets with atomic types, bare metal x86, etc.:
stddisabledportable-atomicdisabled
- Embedded targets without atomic types (e.g. single-core MCUs):
stddisabled,portable-atomicenabledTurning on
portable-atomictogether withstdwill fall back tostdatomic.
1399d95 (no_std) Make palette and serde features depends on std by @j-g00da in #1919
b32f781 (no_std) Make ratatui-macros no-std by @j-g00da in #1865
3e1c72f (no_std) Make ratatui compatible with #![no_std] by @j-g00da in #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 (no_std) Option to disable layout cache for no_std compatibility by @j-g00da in #1795 [breaking]
Resolves #1780
BREAKING CHANGE:Disabling
default-featureswill now disable layout cache, which can have a negative impact on performance.
Layout::init_cacheandLayout::DEFAULT_CACHE_SIZEare now only available iflayout-cachefeature is enabled.
09173d1 (no_std) Make TestBackend::Error Infallible by @j-g00da in #1823 [breaking]
BREAKING CHANGE:
TestBackendnow usescore::convert::Infalliblefor error handling instead ofstd::io::Error
007713e (no_std) Replace Backend's io::Error usages with associated Error type by @j-g00da in #1778 [breaking]
Resolves #1775
BREAKING CHANGE:Custom backends now have to implement
Backend::ErrorandBackend::clear_region. Additionally some genericBackendusage will have to explicitly set trait bounds forBackend::Error.
a42a17e (no_std) Make ratatui-widgets no_std by @j-g00da in #1779
Resolves #1776
5a232a3 (no_std) Remove redundant std usages in ratatui-widgets by @j-g00da in #1762
ebe10cd (no_std) Remove redundant std usages in ratatui-core by @j-g00da in #1753
Resolves https://github.com/ratatui/ratatui/issues/1751
08b08cc (rect) Centering by @janTatesa in #1814
Resolves #617
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #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.
let mut state = ScrollbarState::default(); state.next();This commit adds a new method "
current_position" (sincepositionis already taken by the fluent setter) for that purpose:let index = state.get_position(); // yaySee #1545 for the concrete usage of this.
4c3c054 (serde) Handle null modifiers in serde Style by @joshka in #2172
Allow
Style'sadd_modifierandsub_modifierfields to deserialize fromnull
b9da192 (serde) Derive Serialize/Deserialize for alignment enums by @j-g00da in #1957
Resolves #1954
89b7421 (serde) Derive Serialize/Deserialize for additional structs/enums by @aurreland in #1883
This PR adds
#[derive(Serialize, Deserialize)]to the following structs:
ConstraintDirectionSpacingLayoutAccentedPaletteNonAccentedPalettePalettePaddingBordersBorderTypeListDirectionScrollbarOrientationScrollDirectionRenderDirectionHighlightSpacingFixes #1877
03f3f6d (style) Allow add/sub modifiers to be omitted in Style serialization. by @rcorre in #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_modifierandsub_modifierare not specified. That means the following TOML config:[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 (symbols) Make Marker non-exhaustive by @j-g00da in #2236 [breaking]
This will allow us to add new markers without causing further breaking changes.
BREAKING CHANGE:
Markeris now non-exhaustive
985cd05 (symbols) Add dashed borders by @theotchlx in #1573
Adds several new border sets:
- ratatui::symbols::border::LIGHT_DOUBLE_DASHED
- ratatui::symbols::border::HEAVY_DOUBLE_DASHED
- ratatui::symbols::border::LIGHT_TRIPLE_DASHED
- ratatui::symbols::border::HEAVY_TRIPLE_DASHED
- ratatui::symbols::border::LIGHT_QUADRUPLE_DASHED
- ratatui::symbols::border::HEAVY_QUADRUPLE_DASHED
And corresponding variants to the ratatui::widgets::BorderType enum
Fixes:https://github.com/ratatui/ratatui/issues/1355
4c301e8 (text) Implement AddAssign for Text by @acuteenvy in #1956
This makes it possible to add a second
Textinstance to a first one using the += operator.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 (widgets) Add the missing constructor to canvas types by @orhun in #1538
Allows constructing
Rectangle,PointsandCircleusing thenewmethod instead of initializing with the public fields directly.
22610b0 (uncategorized) Support adding an Offset to Position by @joshka in #2239
Adds Position::offset() and arithmentic ops (Position + Offset and Position - Offset)
Fixes:https://github.com/ratatui/ratatui/issues/2018
24e3133 (uncategorized) Add Rect::resize() method by @joshka in #2240
Fixes:https://github.com/ratatui/ratatui/issues/1440
96d097e (uncategorized) Implement Rect ops for moving by @joshka in #1596
feat:implement Rect ops for moving
Implemented
Add,AddAssign,Sub, andSubAssignonRectforOffset. This makes it possible to move rectslet 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 (uncategorized) Add Size::area() by @joshka in #2226
Add Size::area() returning u32 to avoid u16 overflow Fixes https://github.com/ratatui/ratatui/issues/2204
b6588fd (uncategorized) Implement From<Size> for (u16, u16) by @0xb002f0 in #2223
75b78be (uncategorized) Add width() impl for tabs by @joshka in #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 (uncategorized) Implement UnicodeWidthStr for Text/Line/Span by @joshka in #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 (uncategorized) Add conversion from Size to Rect by @joshka in #2028
Rect::from(size)returns a new Rect at the origin (0, 0) with the specifiedSize
017af11 (uncategorized) Preserve block titles when merging borders by @j-g00da in #1977
Resolves #1939
6dcd53b (uncategorized) Add ergonomic methods for layouting Rects by @joshka in #1909
This commit introduces new methods for the
Rectstruct that simplify the process of splitting aRectinto sub-rects according to a givenLayout. By putting these methods on theRectstruct, we make it a bit more natural that a layout is applied to theRectitself, rather than passing aRectto theLayoutstruct to be split.Adds:-
Rect::layoutandRect::try_layoutmethods that allow splitting aRectinto an array of sub-rects according to a givenLayout.
Rect::layout_vecmethod that returns aVecof sub-rects.Layout::try_areasmethod that returns an array of sub-rects, with compile-time checks for the number of constraints. This is added mainly for consistency with the newRectmethods.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 (uncategorized) Add Rect::outer() by @joshka in #1929
Fixes:https://github.com/ratatui/ratatui/issues/211
7bc78bc (uncategorized) Add ratatui::run() method by @joshka in #1707
This introduces a new
ratatui::run()method which runs a closure with a terminal initialized with reasonable defaults for most applications. This callsratatui::init()before running the closure andratatui::restore()after the closure completes, and returns the result of the closure.A minimal hello world example using the new
ratatui::run()method: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:
fn run(terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } ratatui::run(run)?;struct App { ... } impl App { fn new() -> Self { ... } fn run(mut self, terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } } ratatui::run(|terminal| App::new().run(terminal))?;
b6fbfcd (uncategorized) Add lifetime to symbol sets by @joshka in #1935
This makes it possible to create symbol sets at runtime with non-static lifetimes.
Fixes:https://github.com/ratatui/ratatui/issues/1722
488e5f0 (uncategorized) Make border! work without importing Borders by @j-g00da in #1918
Currently using
border!macro requires explicit import ofBorderswhich is unnecessary.
671c2b4 (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 (uncategorized) Implement stylize methods directly on Style by @joshka in #1572 [breaking]
This makes it possible to create constants using the shorthand methods.
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:
Styleno longer implementsStyled. 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 existingreset()method. UseStyle::reset()rather thansome_style.reset()Fixes:#1158
4fcd238 (uncategorized) Support no-std for calendar widget by @joshka in #1852
Removes the CalendarEventStore::today() function in no-std environments
53cdbbc (uncategorized) Enable serde propagation to backend crates (crossterm, termion) by @ArjunKrish7356 in #1812
This PR propagates the serde feature from the main ratatui crate to the ratatui-crossterm and ratatui-termion backend crates. Solves #1805
6836a69 (uncategorized) Implement styled for other primitives by @aschey in #1684
fcb47d6 (uncategorized) Rename Alignment to HorizontalAlignment and add VerticalAlignment by @joshka in #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
Alignmentenum has been renamed toHorizontalAlignmentto 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.- use ratatui::layout::Alignment; + use ratatui::layout::HorizontalAlignment; - use Alignment::*; + use HorizontalAlignment::*;
2714d6b (uncategorized) Add array and tuple RGB color conversion methods by @joshka in #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::Rgbinstance. Any alpha value is ignored.Color::from([255, 0, 0]); Color::from((255, 0, 0)); Color::from([255, 0, 0, 255]); Color::from((255, 0, 0, 255));
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
Move the Mascot from Demo2 into a new widget. Make the Rat grey and adjust the other colors.
frame.render_widget(RatatuiMascot::default(), frame.area());
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #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.
a89d3d6 (buffer) Clear behavior with VS16 wide emojis by @nornagon in #2063
This fixes a bug where certain emojis like ⌨️ would sometimes be "overlaid" onto existing content from the buffer, instead of properly clearing.
This PR was generated by Codex, and validated by me:
- Behavior of the above example code was buggy before this fix (showed overlaying "b" on top of the keyboard emoji), and fixed after.
- 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 (canvas) Round coordinates to nearest grid cell by @joshka in #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 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #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 (ci) Add contents write permission to release-plz PR by @marcoieni in #2119
https://release-plz.dev/docs/github/quickstart#3-setup-the-workflow
Fixes https://github.com/release-plz/release-plz/issues/2439
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #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 (demo) Update the width of demo2 tape by @orhun in #2164
fixes #1721
dca331c (demo) Support tab key in demo2 example by @orhun in #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-destroymostly.
0fd4753 (examples) Run the correct example for chart by @orhun in #1679
fixes #1678
39479e2 (examples) Ensure that example projects are not published by @orhun in #1672
9314312 (layout) Feature flag cache related types by @joshka in #1842
2dd1977 (layout-cache) Import NonZeroUsize only when layout-cache is enabled by @j-g00da in #1839
This silences unused import warning, when
layout-cacheis disabled.
564a9d7 (line-gauge) Pad default label to display 3 numbers by @martinetd in #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 (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
The canvas map constants are now statics instead. Fixes https://rust-lang.github.io/rust-clippy/master/index.html#large_const_arrays
2e54d5e (macros) Use $crate re-export in text macro by @airblast-dev in #1832
79d5165 (no_std) Propagate std feature flag to dependencies by @j-g00da in #1838
Disables
stdfeature flags in dependencies and only enables them withratatuiandratatui-core'sstdfeature flag. This partially fixes the issue of still depending onstd, whenstdfeature flag is disabled.
00da8c6 (no_std) Provide f64 polyfills for no_std compatibility by @j-g00da in #1840
Related:https://github.com/rust-lang/rust/issues/137578
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
This adds the
area.is_empty()back into the scrollbar render method. Without it, the widget panics if the height is 0.
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
0a25bc1 (tests) Update the stderr snapshot for ratatui-macros by @orhun in #2161
New 🦀 broke the CI
5fa342c (widgets) Fix centered block title truncation by @ognis1205 in #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 (uncategorized) String_to_string lint is now part of implicit_clone by @joshka in #2173
1fe64de (uncategorized) Include underline color in anstyle conversion by @aschey in #2004
Underline color wasn't included in the style conversion logic.
c1b8528 (uncategorized) Panic when rendering widgets on too small buffer by @j-g00da in #1996
Fixes panic on overflow on horizontal
BarchartandRatatuiMascotand adds proper tests to all widgets.
08b21fa (uncategorized) Fix panic when rendering a Paragraph out of bounds by @jwodder in #1670
Fixes #1667.
80bc818 (uncategorized) Fix truncation of left aligned block titles by @joshka in #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 (uncategorized) Fix handling of multi-byte chars in bar chart by @joshka in #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 (uncategorized) Derive copy for list state by @janTatesa in #1921
12cb5a2 (uncategorized) Allow canvas area to exceed u16::MAX by @Daksh14 in #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 (uncategorized) Typo in changelog by @joshka in #1857
c238aca (uncategorized) padding_right() should set right padding instead of left by @sxyazi in #1837
Fixes https://github.com/ratatui/ratatui/issues/1836
c90ba97 (uncategorized) Avoid unnecessary imports in minimal build by @cgzones in #1787
core::ops::Range is only used with the feature
scrolling-regions. Ensure a minimalcargo checkreports no warnings.
416ebdf (uncategorized) Correct clippy errors introduced by rust 1.86.0 update by @j-g00da in #1755
New version of rust (1.86.0) caused CI to fail.
4eac5b2 (uncategorized) Make deprecation notes more helpful by @joshka in #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 usingBuffer::get(x, y)instead ofBuffer[(x, y)].
35a8642 (uncategorized) Rect::positions() should be empty when width is 0 and height is nonzero by @jwodder in #1669
Fixes #1666.
f5fc819 (uncategorized) Avoid extra line break on whitespace only lines when wrapping paragraphs by @dotdash in #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 (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #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.
8d60e96 (examples) Use crossterm event methods by @joshka in #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 (no_std) Make usages of std explicit in ratatui-core. by @ed-2100 in #1782
This commit does the following:
- Adds
#[no_std]tolib.rs.- Adds
extern crate std;tolib.rs.- Updates
ratatui-coreto explicitlyuseitems from std and alloc.- Prefers
use-ing alloc over std when possible.Explanation:
This allows usages of
stdinratatui-coreto be clearly pointed out and dealt with individually.Eventually, when
stdis to be feature gated, the associated commit will be much cleaner.
f132fa1 (table) Small readability improvements by @joshka in #1510
c7c3498 (uncategorized) Use saturating_add in Rect::new by @pharrison31415 in #2216
02e53de (uncategorized) Make use of iter::repeat_n() by @cgzones in #1788
Applied via clippy --fix. Available since 1.82.0.
a195d59 (uncategorized) Move xtask commands to small modules by @joshka in #1620
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
Backend code is now moved to
ratatui-crossterm,ratatui-termionandratatui-termwiz. This should be backwards compatible with existing code.
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
This is a preparatory refactoring for modularization. No user visible changes.
40e96a2 (block) Add collapsed border example by @joshka in #1899
d291042 (block) Revise the block example by @orhun in #1520
- Moves the block example from
ratatuitoratatui-widgets- Simplifies the example (bordered, styled, custom borders)
see #1512
0951da5 (breaking-changes) Improve migration guide for Backend::Error by @j-g00da in #1908
Related:https://github.com/fujiapple852/trippy/pull/1588
bbe1cf9 (breaking-changes) Change MSRV to 1.85 by @j-g00da in #1896
The minimum supported Rust version is now for
ratatuiv0.30 is 1.85
c7912f3 (breaking-changes) Fix header level by @j-g00da in #1825
73488ab (contributing) Fix link to widgets_block_renders test by @ognis1205 in #2101
The
CONTRIBUTING.mdreferencedtests/widgets_block.rs, but the correct path isratatui/tests/widgets_block.rs. Updated the link so that readers can navigate to the test example without 404 error.
1197b2a (contributing) Add note about using nightly for formatting by @joshka in #1816
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
- Updates
CONTRIBUTING.mdabout the usage ofxtask- Removes
Makefile.toml
22e3e84 (core) Remove link to Paragraph widget by @orhun in #1683
b65788c (examples) Remove duplicated link by @matthiasbeyer in #2212
200b217 (examples) Add VHS tapes and docs for widget examples by @orhun in #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 (examples) Fix a typo by @j-g00da in #1890
Makes CI typos check pass again
882cc3c (examples) Update app examples with tapes by @orhun in #1673
4393fae (examples) Move scrollbar example to examples folder by @orhun in #1665
9ea70e2 (examples) Move widget-impl example to examples folder by @orhun in #1663
774ab78 (examples) Move widget-ref-container example to examples folder by @orhun in #1664
see #1512
910d16e (examples) Move user-input example to examples folder by @orhun in #1659
dbfb7da (examples) Move table example to examples folder by @orhun in #1657
cb2a58a (examples) Move tracing example to examples folder by @orhun in #1658
7e00b64 (examples) Move panic example to examples folder by @orhun in #1655
8127590 (examples) Move modifiers example to examples folder by @orhun in #1654
7c40c0b (examples) Move popup example to examples folder by @orhun in #1656
see #1512
d87354f (examples) Move list example to examples folder by @orhun in #1653
see #1512
also renames it to todo-list
621226f (examples) Move inline example to examples folder by @orhun in #1651
9ba7d25 (examples) Move hyperlink example to examples folder by @orhun in #1650
bb94d1c (examples) Move minimal example to examples folder by @orhun in #1649
9f399ac (examples) Move gauge example to examples folder by @orhun in #1646
104d6a6 (examples) Move custom-widget example to examples folder by @orhun in #1644
fa8ca01 (examples) Move flex example to examples folder by @orhun in #1642
f5fde0e (examples) Move constraints example to examples folder by @orhun in #1641
fc70288 (examples) Move constraint-explorer example to examples folder by @orhun in #1640
325f961 (examples) Move hello-world example to examples folder by @orhun in #1647
867c4bc (examples) Move colors-rgb example to examples folder by @joshka in #1582
- docs: move colors-rgb example to examples folder
- docs: update main examples README
72334ed (layout) Update documentation to point to kasuari solver by @a-kenji in #2003
2be9ccb (layout) Remove unnecessary path prefix by @j-g00da in #1766
b669ceb (layout) Change cassowary to kasuari crate reference by @j-g00da in #1765
f907c74 (license) Update copyright years by @LVivona in #1639
Update MIT Licence to copyright year 2025
68b9f67 (readme) Add Built with Ratatui badge for downstream projects by @harilvfs in #1905
6e43672 (readme) Reimagine README.md by @orhun in #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 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
8e5151f (rect) Fix typo in the Rect::outer function comments by @orhun in #2123
40f13c6 (rect) Update the outdated comment for Rect::area() by @isgin01 in #2100
The return value of Rect.area() is no longer of u16 type, and the value is not being clumped anymore.
9a930a6 (terminal) Made usage of Terminal::get_frame() clearer by @Blaeriz in #2071
Closes : https://github.com/ratatui/ratatui/issues/1200
b08b4cb (terminal) Add disclaimer about panics to Terminal::new by @lolbinarycat in #2088
part of #2087
cc @orhun
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
related #1512
ed5dd73 (widgets) Add example for tabs by @orhun in #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 (widgets) Add example for scrollbar by @orhun in #1545
Related to: #1512
898aef6 (widgets) Add example for list by @orhun in #1542
Related to: #1512
452366a (widgets) Add example for sparkline by @orhun in #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 (widgets) Add example for table by @orhun in #1557
related #1512
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
better stonks
15f442a (widgets) Add example for paragraph by @orhun in #1544
related #1512
Also removes the paragraph example from
ratatuisince these examples are more or less the same.
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
related #1512
Also updates the code to make it consistent with the other examples
f2451e7 (widgets) Add example for gauge by @orhun in #1539
related #1512
4f0a8b2 (widgets) Add example for canvas by @orhun in #1533
related #1512
91147c4 (widgets) Add example for chart by @orhun in #1536
stonks
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
related #1512
99ac005 (widgets) Add simple barchart example by @joshka in #1511
b1d47e7 (uncategorized) Discourage use of Buffer's pos_of, index_of by @pharrison31415 in #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 (uncategorized) Fix: fix typos by @j-g00da in #2129
This fixes the pipeline after bumping typos.
9998000 (uncategorized) Use shields.io badge by @LitoMore in #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 :v:
And it's customizable. There are more configurations at https://shields.io/badges.
Here are some examples:
    
I also created a PR to the ratatui-website project to update the badge. Here is the PR:
- https://github.com/ratatui/ratatui-website/pull/924
71ef65b (uncategorized) Add section on collaborative development to contributing doc by @joshka in #2029
cba5cca (uncategorized) Update heading image for Ratatui 0.30.0 release 🎉 by @j-g00da in #2000
9836f07 (uncategorized) Add AI contribution guidelines by @joshka in #2013
98f85b8 (uncategorized) Update link to scrollable widgets RFC by @MatrixFrog in #1994
055522e (uncategorized) Add docs for authoring widget crates by @j-g00da in #1955
- added Authoring Widget Libraries sub-section
- moved built-in and third-party widgets sections higher
617d318 (uncategorized) Improve Block docs by @joshka in #1953
8e2d568 (uncategorized) Improve layout related docs by @joshka in #1948
Adds module level docs and more comprehensive docs on all the types in the layout module
Fixes #1937
4c708dd (uncategorized) Improve docs for run/init/restore etc. by @joshka in #1947
- docs: document the init module
- docs: use the ratatui::run() methods in the main doc
- docs: add more intradoc / website links and historical perspective on Terminal / backend
- docs: add notes about new run/init/restore methods and the defaultterminal type to terminal docs
5620e06 (uncategorized) Add crate organization sections to workspace by @joshka in #1946
Adds summary-level crate organization documentation to all crates explaining the modular workspace structure and when to use each crate. Links to ARCHITECTURE.md for detailed information.
cfb65e6 (uncategorized) Add examples for handling state by @joshka in #1849
Added comprehensive state management examples covering both immutable and mutable patterns and documentation to help developers choose the right approach for their applications.
3de41a8 (uncategorized) Document widgets module by @joshka in #1932
Adds a good overview of the use and implementation of widget traits.
Goals with the doc rewrite:
- document the rationale for the ratatui-widgets crate with info for app builders and widget makers.
- Show how to use the widgets for rendering as well as implement the traits- document the differences and reasons for each trait
- document the historical perspective (to make it easy to understand older Ratatui apps as well as migrate to newer approaches
- give recommended approaches to implementing traits
- explain the differences between Consuming and Shared / Mutable Reference implementations of Widget
- explain the differences between using StatefulWidget and Mutable References
- Explain the use case for WidgetRef and StatefulWidgetRef
- Link out to third part widget lists
Fixes:https://github.com/ratatui/ratatui/issues/366
ca2ad4a (uncategorized) Simplify ratatui-macro docs by @joshka in #1923
92b6a16 (uncategorized) Fix grammar in ratatui-widgets README by @sevki in #1885
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
Implements ideas alluded to by https://discord.com/channels/1070692720437383208/1072907135664529508/1323061053990637640 and followup conversations.
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
Fix wording in
user_input.rsexample.
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
Fix end of sentence punctuation in canvas.rs docs.
e411d9e (uncategorized) Add input form example by @joshka in #1551
Demonstrates how to manage the cursor and input focus with a simple form. Uses an enum to track the current input field and passes the input events to the active field.
This is similar to the json tutorial on the website, but a bit simpler
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
Demonstrates how to handle mouse events
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
Overall makes improvements in the documentation of the workspace crates and checking them.
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
1f41a61 (paragraph) Avoid unnecessary work when rendering by @alexpasmantier in #1622
Improve render times for paragraphs that are scrolled.
Currently all
LineComposers are considered to be state machines which means rendering a paragraph with a given Y offset requires computing the entire state up to Y before being able to render from Y onwards.While this makes sense for Composers such as the
WordWrapper(where one needs to consider all previous lines to determine where a given line will end up), it means it also penalizes Composers which can render a given line "statelessely" (such as theLineTruncator) which actually end up doing a lot of unnecessary work (and on the critical rendering path) when the offset gets high.
ba9eed7 (table) Replace while loop with simple min operation by @EdJoPaTo in #1747
345f47e (rect) Use plus operator for offset by @pharrison31415 in #2251
Summary
Use
+operator to moveRectby anOffsetas added here.Includes change to use
Offset::new()in place ofOffset { ... }
ac60de3 (uncategorized) Fix wrapping in doc comment by @joshka in #2104
2739391 (uncategorized) Use Module imports_granularity by @joshka in #1728
I was swayed by the arguments about this made by the compiler team In https://github.com/rust-lang/compiler-team/issues/750 and decided to look at how this organization affects ratatui. I found this reduces the number of lines across the codebase by about 350 and makes the imports more readable and definitely more greppable as you usually only have to read a single line. I've found in the past that maintaining imports regularly leads to merge conflicts which have to be resolved by hand and this change should reduce the likelihood of that happening.
Main change is in rustfmt.toml, and the rest is just the result of running
cargo xtask format.While implementing this, cargo machete brings up that the various backend crates are unused by the example crates.
The re-export of each backend crate under ratatui is to make it possible for libs that rely on a specific version of ratatui to use the same version of the backend crate. Apps in general should use the backend crate directly rather than through ratatui as this is less confusing.
- Removes all usages of `ratatui::{crossterm, termion, termwiz}`` in the examples.
- Adds the backend crate to the dependencies of the examples that use the backend crate directly.
db65aa0 (bench) Add benchmark for text by @orhun in #2160
#2138
a21501f (bench) Added a benchmark for constraints by @kashregister in #2043
I've added a new benchmark for constraints, which only takes into account the time it takes to generate a full layout using a single type of constraints only. Avoided rendering here as it resulted in more inaccurate benchmarks, and i believe it should be separated nonetheless.
94ba82e (gauge) Add benchmarks for gauge by @WaterWhisperer in #2221
39cd313 (layout) Add visual buffer tests for Rect methods by @orhun in #2124
8aefc06 (macros) Regenerate trybuild stderr by @ognis1205 in #2093
Overview
Updated the
.stderrfile corresponding to theratatui-macros/tests/ui/fails.rscompile-fail test.Changes
- Updated
tests/ui/fails.stderrto match the new compiler output.Impact
- Affects only the trybuild UI tests
- No impact on production code
Notes
- The
.stderrwas generated usingTRYBUILD=overwrite cargo test.Closes https://github.com/ratatui/ratatui/issues/2094
55a95e6 (rect) Mutual intersection agreement by @pharrison31415 in #2252
deb1b8e (uncategorized) Ensure Style::new() and Style::default() are equivalent by @cgzones in #1789
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
Adds two traits
IntoCrosstermandFromCrosstermfor converting between ratatui and crossterm types. This is necessary in order to avoid the orphan rule when implementingFromfor crossterm types once the crossterm types are moved to a separate crate.Similarly Termwiz and Termwiz gain FromTermion, IntoTermion, FromTermwiz and IntoTermwiz traits.
BREAKING CHANGE:The
FromandIntoimpls for backend types are now replaced with specific backend traits.+ use ratatui::backend::{FromCrossterm, IntoCrossterm}; let crossterm_color = crossterm::style::Color::Black; - let ratatui_color = crossterm_color.into(); - let ratatui_color = ratatui::style::Color::from(crossterm_color); + let ratatui_color = ratatui::style::Color::from_crossterm(crossterm_color); - let crossterm_color = ratatui_color.into(); - let crossterm_color = crossterm::style::Color::from(ratatui_color); + let
Note truncated.
Item by a generic and flexible Text that can be used in both
Paragraph and List widgets.Style.⚠️ List of breaking changes can be found here.
"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://ratatui-0-30.ratatui.pages.dev/highlights/v030/
⚠️ List of breaking changes can be found here.
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
BREAKING CHANGE:label and text_value now accept
Into<>types, which breaks type inference.- Bar::default().label("foo".into()); + Bar::default().label("foo");- Bar::default().text_value("bar".into()); + Bar::default().text_value("bar");
b76ad3b (bar) Impl Styled for Bar by @Emivvvvv in #1476
Related:https://github.com/ratatui/ratatui/issues/683
e15fefa (barchar) Add BarChart::grouped constructor by @joshka in #1513
Add a new constructor to the
BarChartwidget that allows creating a grouped barchart with multiple groups of bars.Also add a new constructor to the
BarGroupwidget that allows creating a group of bars with a label.
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
Adds constructor methods for BarChart, BarGroup, and Bar
2d713d7 (crossterm) Allow multiple crossterm versions by @joshka in #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_28andcrossterm_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 (layout) Add Flex::SpaceEvenly by @kdheepak in #1952 [breaking]
Resolves https://github.com/ratatui/ratatui/issues/1951
BREAKING CHANGE:Old
Flex::SpaceAroundbehavior is available by using
Flex::SpaceEvenlyand new
Flex::SpaceAroundnow distributes space evenly around each element except the middle spacers are twice the size of first and last elementsWith this change, the following variants of
Flexare 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(previouslyFlex::SpaceAround): Distributes space evenly between items and edges.Flex::Legacy: Preserves legacy behavior, placing all excess space at the end.This aligns behavior of
Flexwith 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 (layout) Add Offset::new() constructor by @joshka in #1547
7ad9c29 (linegauge) Customized symbols by @sectore in #1601
With this PR any symbol (
&str) can be used to renderfilledandunfilledparts ofLineGaugenow. Before that change, onlysymbols::line::Setwas accepted.Note:New methods are introduced to define those symbols:
filled_symbolandunfilled_symbol. The methodline_setis still there, but marked asdeprecated.
92a19cb (list) Highlight symbol styling by @airblast-dev in #1595 [breaking]
Allow styling for
List's highlight symbolThis change makes it so anything that implements
Into<Line>can be used as a highlight symbol.BREAKING CHANGE:
List::highlight_symbolcan no longer be used in const contextBREAKING CHANGE:
List::highlight_symbolaccepted&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 (no_std) Portable-atomic integration for targets with no atomic types by @j-g00da in #2076
Improves compatibility with no-std targets that don't support atomic types.
We support three different scenarios depending on the target:
- Terminal applications and other std targets (e.g. espidf):
stdenabled,portable-atomicdisabled
- Embedded targets with atomic types, bare metal x86, etc.:
stddisabledportable-atomicdisabled
- Embedded targets without atomic types (e.g. single-core MCUs):
stddisabled,portable-atomicenabledTurning on
portable-atomictogether withstdwill fall back tostdatomic.
1399d95 (no_std) Make palette and serde features depends on std by @j-g00da in #1919
b32f781 (no_std) Make ratatui-macros no-std by @j-g00da in #1865
3e1c72f (no_std) Make ratatui compatible with #![no_std] by @j-g00da in #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 (no_std) Option to disable layout cache for no_std compatibility by @j-g00da in #1795 [breaking]
Resolves #1780
BREAKING CHANGE:Disabling
default-featureswill now disable layout cache, which can have a negative impact on performance.
Layout::init_cacheandLayout::DEFAULT_CACHE_SIZEare now only available iflayout-cachefeature is enabled.
09173d1 (no_std) Make TestBackend::Error Infallible by @j-g00da in #1823 [breaking]
BREAKING CHANGE:
TestBackendnow usescore::convert::Infalliblefor error handling instead ofstd::io::Error
007713e (no_std) Replace Backend's io::Error usages with associated Error type by @j-g00da in #1778 [breaking]
Resolves #1775
BREAKING CHANGE:Custom backends now have to implement
Backend::ErrorandBackend::clear_region. Additionally some genericBackendusage will have to explicitly set trait bounds forBackend::Error.
a42a17e (no_std) Make ratatui-widgets no_std by @j-g00da in #1779
Resolves #1776
5a232a3 (no_std) Remove redundant std usages in ratatui-widgets by @j-g00da in #1762
ebe10cd (no_std) Remove redundant std usages in ratatui-core by @j-g00da in #1753
Resolves https://github.com/ratatui/ratatui/issues/1751
08b08cc (rect) Centering by @janTatesa in #1814
Resolves #617
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #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.
let mut state = ScrollbarState::default(); state.next();This commit adds a new method "
current_position" (sincepositionis already taken by the fluent setter) for that purpose:let index = state.get_position(); // yaySee #1545 for the concrete usage of this.
b9da192 (serde) Derive Serialize/Deserialize for alignment enums by @j-g00da in #1957
Resolves #1954
89b7421 (serde) Derive Serialize/Deserialize for additional structs/enums by @aurreland in #1883
This PR adds
#[derive(Serialize, Deserialize)]to the following structs:
ConstraintDirectionSpacingLayoutAccentedPaletteNonAccentedPalettePalettePaddingBordersBorderTypeListDirectionScrollbarOrientationScrollDirectionRenderDirectionHighlightSpacingFixes #1877
03f3f6d (style) Allow add/sub modifiers to be omitted in Style serialization. by @rcorre in #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_modifierandsub_modifierare not specified. That means the following TOML config:[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".
985cd05 (symbols) Add dashed borders by @theotchlx in #1573
Adds several new border sets:
- ratatui::symbols::border::LIGHT_DOUBLE_DASHED
- ratatui::symbols::border::HEAVY_DOUBLE_DASHED
- ratatui::symbols::border::LIGHT_TRIPLE_DASHED
- ratatui::symbols::border::HEAVY_TRIPLE_DASHED
- ratatui::symbols::border::LIGHT_QUADRUPLE_DASHED
- ratatui::symbols::border::HEAVY_QUADRUPLE_DASHED
And corresponding variants to the ratatui::widgets::BorderType enum
Fixes:https://github.com/ratatui/ratatui/issues/1355
4c301e8 (text) Implement AddAssign for Text by @acuteenvy in #1956
This makes it possible to add a second
Textinstance to a first one using the += operator.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 (widgets) Add the missing constructor to canvas types by @orhun in #1538
Allows constructing
Rectangle,PointsandCircleusing thenewmethod instead of initializing with the public fields directly.
75b78be (uncategorized) Add width() impl for tabs by @joshka in #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 (uncategorized) Implement UnicodeWidthStr for Text/Line/Span by @joshka in #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 (uncategorized) Add conversion from Size to Rect by @joshka in #2028
Rect::from(size)returns a new Rect at the origin (0, 0) with the specifiedSize
017af11 (uncategorized) Preserve block titles when merging borders by @j-g00da in #1977
Resolves #1939
6dcd53b (uncategorized) Add ergonomic methods for layouting Rects by @joshka in #1909
This commit introduces new methods for the
Rectstruct that simplify the process of splitting aRectinto sub-rects according to a givenLayout. By putting these methods on theRectstruct, we make it a bit more natural that a layout is applied to theRectitself, rather than passing aRectto theLayoutstruct to be split.Adds:-
Rect::layoutandRect::try_layoutmethods that allow splitting aRectinto an array of sub-rects according to a givenLayout.
Rect::layout_vecmethod that returns aVecof sub-rects.Layout::try_areasmethod that returns an array of sub-rects, with compile-time checks for the number of constraints. This is added mainly for consistency with the newRectmethods.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 (uncategorized) Add Rect::outer() by @joshka in #1929
Fixes:https://github.com/ratatui/ratatui/issues/211
7bc78bc (uncategorized) Add ratatui::run() method by @joshka in #1707
This introduces a new
ratatui::run()method which runs a closure with a terminal initialized with reasonable defaults for most applications. This callsratatui::init()before running the closure andratatui::restore()after the closure completes, and returns the result of the closure.A minimal hello world example using the new
ratatui::run()method: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:
fn run(terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } ratatui::run(run)?;struct App { ... } impl App { fn new() -> Self { ... } fn run(mut self, terminal: &mut DefaultTerminal) -> Result<(), AppError> { ... } } ratatui::run(|terminal| App::new().run(terminal))?;
b6fbfcd (uncategorized) Add lifetime to symbol sets by @joshka in #1935
This makes it possible to create symbol sets at runtime with non-static lifetimes.
Fixes:https://github.com/ratatui/ratatui/issues/1722
488e5f0 (uncategorized) Make border! work without importing Borders by @j-g00da in #1918
Currently using
border!macro requires explicit import ofBorderswhich is unnecessary.
671c2b4 (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 (uncategorized) Implement stylize methods directly on Style by @joshka in #1572 [breaking]
This makes it possible to create constants using the shorthand methods.
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:
Styleno longer implementsStyled. 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 existingreset()method. UseStyle::reset()rather thansome_style.reset()Fixes:#1158
4fcd238 (uncategorized) Support no-std for calendar widget by @joshka in #1852
Removes the CalendarEventStore::today() function in no-std environments
53cdbbc (uncategorized) Enable serde propagation to backend crates (crossterm, termion) by @ArjunKrish7356 in #1812
This PR propagates the serde feature from the main ratatui crate to the ratatui-crossterm and ratatui-termion backend crates. Solves #1805
6836a69 (uncategorized) Implement styled for other primitives by @aschey in #1684
fcb47d6 (uncategorized) Rename Alignment to HorizontalAlignment and add VerticalAlignment by @joshka in #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
Alignmentenum has been renamed toHorizontalAlignmentto 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.- use ratatui::layout::Alignment; + use ratatui::layout::HorizontalAlignment; - use Alignment::*; + use HorizontalAlignment::*;
2714d6b (uncategorized) Add array and tuple RGB color conversion methods by @joshka in #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::Rgbinstance. Any alpha value is ignored.Color::from([255, 0, 0]); Color::from((255, 0, 0)); Color::from([255, 0, 0, 255]); Color::from((255, 0, 0, 255));
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
Move the Mascot from Demo2 into a new widget. Make the Rat grey and adjust the other colors.
frame.render_widget(RatatuiMascot::default(), frame.area());
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #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.
a89d3d6 (buffer) Clear behavior with VS16 wide emojis by @nornagon in #2063
This fixes a bug where certain emojis like ⌨️ would sometimes be "overlaid" onto existing content from the buffer, instead of properly clearing.
This PR was generated by Codex, and validated by me:
- Behavior of the above example code was buggy before this fix (showed overlaying "b" on top of the keyboard emoji), and fixed after.
- 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 (canvas) Round coordinates to nearest grid cell by @joshka in #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 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #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 (ci) Add contents write permission to release-plz PR by @marcoieni in #2119
https://release-plz.dev/docs/github/quickstart#3-setup-the-workflow
Fixes https://github.com/release-plz/release-plz/issues/2439
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #1541
The Dim removal should behave the same as the logic for Bold removal that sends NormalIntensity sequence and then restores Dim when needed.
dca331c (demo) Support tab key in demo2 example by @orhun in #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-destroymostly.
0fd4753 (examples) Run the correct example for chart by @orhun in #1679
fixes #1678
39479e2 (examples) Ensure that example projects are not published by @orhun in #1672
9314312 (layout) Feature flag cache related types by @joshka in #1842
2dd1977 (layout-cache) Import NonZeroUsize only when layout-cache is enabled by @j-g00da in #1839
This silences unused import warning, when
layout-cacheis disabled.
564a9d7 (line-gauge) Pad default label to display 3 numbers by @martinetd in #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 (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
The canvas map constants are now statics instead. Fixes https://rust-lang.github.io/rust-clippy/master/index.html#large_const_arrays
2e54d5e (macros) Use $crate re-export in text macro by @airblast-dev in #1832
79d5165 (no_std) Propagate std feature flag to dependencies by @j-g00da in #1838
Disables
stdfeature flags in dependencies and only enables them withratatuiandratatui-core'sstdfeature flag. This partially fixes the issue of still depending onstd, whenstdfeature flag is disabled.
00da8c6 (no_std) Provide f64 polyfills for no_std compatibility by @j-g00da in #1840
Related:https://github.com/rust-lang/rust/issues/137578
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
This adds the
area.is_empty()back into the scrollbar render method. Without it, the widget panics if the height is 0.
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
0a25bc1 (tests) Update the stderr snapshot for ratatui-macros by @orhun in #2161
New 🦀 broke the CI
5fa342c (widgets) Fix centered block title truncation by @ognis1205 in #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.
1fe64de (uncategorized) Include underline color in anstyle conversion by @aschey in #2004
Underline color wasn't included in the style conversion logic.
c1b8528 (uncategorized) Panic when rendering widgets on too small buffer by @j-g00da in #1996
Fixes panic on overflow on horizontal
BarchartandRatatuiMascotand adds proper tests to all widgets.
08b21fa (uncategorized) Fix panic when rendering a Paragraph out of bounds by @jwodder in #1670
Fixes #1667.
80bc818 (uncategorized) Fix truncation of left aligned block titles by @joshka in #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 (uncategorized) Fix handling of multi-byte chars in bar chart by @joshka in #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 (uncategorized) Derive copy for list state by @janTatesa in #1921
12cb5a2 (uncategorized) Allow canvas area to exceed u16::MAX by @Daksh14 in #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 (uncategorized) Typo in changelog by @joshka in #1857
c238aca (uncategorized) padding_right() should set right padding instead of left by @sxyazi in #1837
Fixes https://github.com/ratatui/ratatui/issues/1836
c90ba97 (uncategorized) Avoid unnecessary imports in minimal build by @cgzones in #1787
core::ops::Range is only used with the feature
scrolling-regions. Ensure a minimalcargo checkreports no warnings.
416ebdf (uncategorized) Correct clippy errors introduced by rust 1.86.0 update by @j-g00da in #1755
New version of rust (1.86.0) caused CI to fail.
4eac5b2 (uncategorized) Make deprecation notes more helpful by @joshka in #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 usingBuffer::get(x, y)instead ofBuffer[(x, y)].
35a8642 (uncategorized) Rect::positions() should be empty when width is 0 and height is nonzero by @jwodder in #1669
Fixes #1666.
f5fc819 (uncategorized) Avoid extra line break on whitespace only lines when wrapping paragraphs by @dotdash in #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 (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #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.
8d60e96 (examples) Use crossterm event methods by @joshka in #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 (no_std) Make usages of std explicit in ratatui-core. by @ed-2100 in #1782
This commit does the following:
- Adds
#[no_std]tolib.rs.- Adds
extern crate std;tolib.rs.- Updates
ratatui-coreto explicitlyuseitems from std and alloc.- Prefers
use-ing alloc over std when possible.Explanation:
This allows usages of
stdinratatui-coreto be clearly pointed out and dealt with individually.Eventually, when
stdis to be feature gated, the associated commit will be much cleaner.
f132fa1 (table) Small readability improvements by @joshka in #1510
02e53de (uncategorized) Make use of iter::repeat_n() by @cgzones in #1788
Applied via clippy --fix. Available since 1.82.0.
a195d59 (uncategorized) Move xtask commands to small modules by @joshka in #1620
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
Backend code is now moved to
ratatui-crossterm,ratatui-termionandratatui-termwiz. This should be backwards compatible with existing code.
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
This is a preparatory refactoring for modularization. No user visible changes.
40e96a2 (block) Add collapsed border example by @joshka in #1899
d291042 (block) Revise the block example by @orhun in #1520
- Moves the block example from
ratatuitoratatui-widgets- Simplifies the example (bordered, styled, custom borders)
see #1512
0951da5 (breaking-changes) Improve migration guide for Backend::Error by @j-g00da in #1908
Related:https://github.com/fujiapple852/trippy/pull/1588
bbe1cf9 (breaking-changes) Change MSRV to 1.85 by @j-g00da in #1896
The minimum supported Rust version is now for
ratatuiv0.30 is 1.85
c7912f3 (breaking-changes) Fix header level by @j-g00da in #1825
eb24938 (changelog) Add note to ratatui-macros' changelog
73488ab (contributing) Fix link to widgets_block_renders test by @ognis1205 in #2101
The
CONTRIBUTING.mdreferencedtests/widgets_block.rs, but the correct path isratatui/tests/widgets_block.rs. Updated the link so that readers can navigate to the test example without 404 error.
1197b2a (contributing) Add note about using nightly for formatting by @joshka in #1816
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
- Updates
CONTRIBUTING.mdabout the usage ofxtask- Removes
Makefile.toml
22e3e84 (core) Remove link to Paragraph widget by @orhun in #1683
200b217 (examples) Add VHS tapes and docs for widget examples by @orhun in #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 (examples) Fix a typo by @j-g00da in #1890
Makes CI typos check pass again
882cc3c (examples) Update app examples with tapes by @orhun in #1673
4393fae (examples) Move scrollbar example to examples folder by @orhun in #1665
9ea70e2 (examples) Move widget-impl example to examples folder by @orhun in #1663
774ab78 (examples) Move widget-ref-container example to examples folder by @orhun in #1664
see #1512
910d16e (examples) Move user-input example to examples folder by @orhun in #1659
dbfb7da (examples) Move table example to examples folder by @orhun in #1657
cb2a58a (examples) Move tracing example to examples folder by @orhun in #1658
7e00b64 (examples) Move panic example to examples folder by @orhun in #1655
8127590 (examples) Move modifiers example to examples folder by @orhun in #1654
7c40c0b (examples) Move popup example to examples folder by @orhun in #1656
see #1512
d87354f (examples) Move list example to examples folder by @orhun in #1653
see #1512
also renames it to todo-list
621226f (examples) Move inline example to examples folder by @orhun in #1651
9ba7d25 (examples) Move hyperlink example to examples folder by @orhun in #1650
bb94d1c (examples) Move minimal example to examples folder by @orhun in #1649
9f399ac (examples) Move gauge example to examples folder by @orhun in #1646
104d6a6 (examples) Move custom-widget example to examples folder by @orhun in #1644
fa8ca01 (examples) Move flex example to examples folder by @orhun in #1642
f5fde0e (examples) Move constraints example to examples folder by @orhun in #1641
fc70288 (examples) Move constraint-explorer example to examples folder by @orhun in #1640
325f961 (examples) Move hello-world example to examples folder by @orhun in #1647
867c4bc (examples) Move colors-rgb example to examples folder by @joshka in #1582
- docs: move colors-rgb example to examples folder
- docs: update main examples README
72334ed (layout) Update documentation to point to kasuari solver by @a-kenji in #2003
2be9ccb (layout) Remove unnecessary path prefix by @j-g00da in #1766
b669ceb (layout) Change cassowary to kasuari crate reference by @j-g00da in #1765
f907c74 (license) Update copyright years by @LVivona in #1639
Update MIT Licence to copyright year 2025
68b9f67 (readme) Add Built with Ratatui badge for downstream projects by @harilvfs in #1905
6e43672 (readme) Reimagine README.md by @orhun in #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 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
8e5151f (rect) Fix typo in the Rect::outer function comments by @orhun in #2123
40f13c6 (rect) Update the outdated comment for Rect::area() by @eqsdxr in #2100
The return value of Rect.area() is no longer of u16 type, and the value is not being clumped anymore.
9a930a6 (terminal) Made usage of Terminal::get_frame() clearer by @Blaeriz in #2071
Closes : https://github.com/ratatui/ratatui/issues/1200
b08b4cb (terminal) Add disclaimer about panics to Terminal::new by @lolbinarycat in #2088
part of #2087
cc @orhun
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
related #1512
ed5dd73 (widgets) Add example for tabs by @orhun in #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 (widgets) Add example for scrollbar by @orhun in #1545
Related to: #1512
898aef6 (widgets) Add example for list by @orhun in #1542
Related to: #1512
452366a (widgets) Add example for sparkline by @orhun in #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 (widgets) Add example for table by @orhun in #1557
related #1512
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
better stonks
15f442a (widgets) Add example for paragraph by @orhun in #1544
related #1512
Also removes the paragraph example from
ratatuisince these examples are more or less the same.
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
related #1512
Also updates the code to make it consistent with the other examples
f2451e7 (widgets) Add example for gauge by @orhun in #1539
related #1512
4f0a8b2 (widgets) Add example for canvas by @orhun in #1533
related #1512
91147c4 (widgets) Add example for chart by @orhun in #1536
stonks
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
related #1512
99ac005 (widgets) Add simple barchart example by @joshka in #1511
f8b0594 (uncategorized) Fix: fix typos by @j-g00da in #2129
This fixes the pipeline after bumping typos.
9998000 (uncategorized) Use shields.io badge by @LitoMore in #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 :v:
And it's customizable. There are more configurations at https://shields.io/badges.
Here are some examples:
    >
I also created a PR to the ratatui-website project to update the badge. Here is the PR:
- https://github.com/ratatui/ratatui-website/pull/924
71ef65b (uncategorized) Add section on collaborative development to contributing doc by @joshka in #2029
cba5cca (uncategorized) Update heading image for Ratatui 0.30.0 release 🎉 by @j-g00da in #2000
9836f07 (uncategorized) Add AI contribution guidelines by @joshka in #2013
98f85b8 (uncategorized) Update link to scrollable widgets RFC by @MatrixFrog in #1994
055522e (uncategorized) Add docs for authoring widget crates by @j-g00da in #1955
- added Authoring Widget Libraries sub-section
- moved built-in and third-party widgets sections higher
617d318 (uncategorized) Improve Block docs by @joshka in #1953
8e2d568 (uncategorized) Improve layout related docs by @joshka in #1948
Adds module level docs and more comprehensive docs on all the types in the layout module
Fixes #1937
4c708dd (uncategorized) Improve docs for run/init/restore etc. by @joshka in #1947
- docs: document the init module
- docs: use the ratatui::run() methods in the main doc
- docs: add more intradoc / website links and historical perspective on Terminal / backend
- docs: add notes about new run/init/restore methods and the defaultterminal type to terminal docs
5620e06 (uncategorized) Add crate organization sections to workspace by @joshka in #1946
Adds summary-level crate organization documentation to all crates explaining the modular workspace structure and when to use each crate. Links to ARCHITECTURE.md for detailed information.
cfb65e6 (uncategorized) Add examples for handling state by @joshka in #1849
Added comprehensive state management examples covering both immutable and mutable patterns and documentation to help developers choose the right approach for their applications.
3de41a8 (uncategorized) Document widgets module by @joshka in #1932
Adds a good overview of the use and implementation of widget traits.
Goals with the doc rewrite:
- document the rationale for the ratatui-widgets crate with info for app builders and widget makers.
- Show how to use the widgets for rendering as well as implement the traits- document the differences and reasons for each trait
- document the historical perspective (to make it easy to understand older Ratatui apps as well as migrate to newer approaches
- give recommended approaches to implementing traits
- explain the differences between Consuming and Shared / Mutable Reference implementations of Widget
- explain the differences between using StatefulWidget and Mutable References
- Explain the use case for WidgetRef and StatefulWidgetRef
- Link out to third part widget lists
Fixes:https://github.com/ratatui/ratatui/issues/366
ca2ad4a (uncategorized) Simplify ratatui-macro docs by @joshka in #1923
92b6a16 (uncategorized) Fix grammar in ratatui-widgets README by @sevki in #1885
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
Implements ideas alluded to by https://discord.com/channels/1070692720437383208/1072907135664529508/1323061053990637640 and followup conversations.
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
Fix wording in
user_input.rsexample.
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
Fix end of sentence punctuation in canvas.rs docs.
e411d9e (uncategorized) Add input form example by @joshka in #1551
Demonstrates how to manage the cursor and input focus with a simple form. Uses an enum to track the current input field and passes the input events to the active field.
This is similar to the json tutorial on the website, but a bit simpler
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
Demonstrates how to handle mouse events
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
Overall makes improvements in the documentation of the workspace crates and checking them.
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
1f41a61 (paragraph) Avoid unnecessary work when rendering by @alexpasmantier in #1622
Improve render times for paragraphs that are scrolled.
Currently all
LineComposers are considered to be state machines which means rendering a paragraph with a given Y offset requires computing the entire state up to Y before being able to render from Y onwards.While this makes sense for Composers such as the
WordWrapper(where one needs to consider all previous lines to determine where a given line will end up), it means it also penalizes Composers which can render a given line "statelessely" (such as theLineTruncator) which actually end up doing a lot of unnecessary work (and on the critical rendering path) when the offset gets high.
ba9eed7 (table) Replace while loop with simple min operation by @EdJoPaTo in #1747
ac60de3 (uncategorized) Fix wrapping in doc comment by @joshka in #2104
2739391 (uncategorized) Use Module imports_granularity by @joshka in #1728
I was swayed by the arguments about this made by the compiler team In https://github.com/rust-lang/compiler-team/issues/750 and decided to look at how this organization affects ratatui. I found this reduces the number of lines across the codebase by about 350 and makes the imports more readable and definitely more greppable as you usually only have to read a single line. I've found in the past that maintaining imports regularly leads to merge conflicts which have to be resolved by hand and this change should reduce the likelihood of that happening.
Main change is in rustfmt.toml, and the rest is just the result of running
cargo xtask format.While implementing this, cargo machete brings up that the various backend crates are unused by the example crates.
The re-export of each backend crate under ratatui is to make it possible for libs that rely on a specific version of ratatui to use the same version of the backend crate. Apps in general should use the backend crate directly rather than through ratatui as this is less confusing.
- Removes all usages of `ratatui::{crossterm, termion, termwiz}`` in the examples.
- Adds the backend crate to the dependencies of the examples that use the backend crate directly.
db65aa0 (bench) Add benchmark for text by @orhun in #2160
#2138
a21501f (bench) Added a benchmark for constraints by @kashregister in #2043
I've added a new benchmark for constraints, which only takes into account the time it takes to generate a full layout using a single type of constraints only. Avoided rendering here as it resulted in more inaccurate benchmarks, and i believe it should be separated nonetheless.
39cd313 (layout) Add visual buffer tests for Rect methods by @orhun in #2124
8aefc06 (macros) Regenerate trybuild stderr by @ognis1205 in #2093
Overview
Updated the
.stderrfile corresponding to theratatui-macros/tests/ui/fails.rscompile-fail test.Changes
- Updated
tests/ui/fails.stderrto match the new compiler output.Impact
- Affects only the trybuild UI tests
- No impact on production code
Notes
- The
.stderrwas generated usingTRYBUILD=overwrite cargo test.Closes https://github.com/ratatui/ratatui/issues/2094
deb1b8e (uncategorized) Ensure Style::new() and Style::default() are equivalent by @cgzones in #1789
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
Adds two traits
IntoCrosstermandFromCrosstermfor converting between ratatui and crossterm types. This is necessary in order to avoid the orphan rule when implementingFromfor crossterm types once the crossterm types are moved to a separate crate.Similarly Termwiz and Termwiz gain FromTermion, IntoTermion, FromTermwiz and IntoTermwiz traits.
BREAKING CHANGE:The
FromandIntoimpls for backend types are now replaced with specific backend traits.+ use ratatui::backend::{FromCrossterm, IntoCrossterm}; let crossterm_color = crossterm::style::Color::Black; - let ratatui_color = crossterm_color.into(); - let ratatui_color = ratatui::style::Color::from(crossterm_color); + let ratatui_color = ratatui::style::Color::from_crossterm(crossterm_color); - let crossterm_color = ratatui_color.into(); - let crossterm_color = crossterm::style::Color::from(ratatui_color); + let crossterm_color = ratatui_color.into_crossterm(); let crossterm_attribute = crossterm::style::types::Attribute::Bold; - let ratatui_modifier = crossterm_attribute.into(); - let ratatui_modifier = ratatui::style::Modifier::from(crossterm_attribute); + let ratatui_modifier = ratatui::style::Modifier::from_crossterm(crossterm_attribute); - let crossterm_attribute = ratatui_modifier.into(); - let crossterm_attribute = crossterm::style::types::Attribute::from(ratatui_modifier); + let crossterm_attribute = ratatui_modifier.into_crossterm();Similar conversions for
ContentStyle->StyleandAttributes->Modifierexist for Crossterm, and all the Termion and Termwiz types.
0a47ebd (bencher) Update bencher CLI usage by @epompeii in #1470
b46778d (breaking-changes) Add details to no_std-related breaking changes by @j-g00da in #1828
Some corrections and added details to BREAKING-CHANGES.md.
I decided to remove:
Backendnow usesSelf::Errorfor error handling instead ofstd::io::ErrorTerminal<B>now usesB::Errorfor error handling instead ofstd::io::Error...as we are still using
std::io::Errorin built-in backends, so this will only be breaking if a third-party backend decides to use a custom error other thanstd::io::Error, which would be a breaking change in downstream and notratatui.The exception to that is
TestBackend, which usesInfallible, but this already has its own breaking changes entry.
a0979d6 (build) Remove cargo lint by @joshka in #1549
Duplicate crate lint is too noisy and sensitive to upstream changes
ae43ea7 (cell) Use Option instead of space (" ") for symbol by @joshka
This change makes the
Cell::symbolfield anOption<CompactString>, allowing it to represent an empty cell asNoneinstead of an empty string. The rationale for this is to later allow the merge symbol functionality to act differently based on whether a cell has previously held a symbol or not, rather than always merging with an empty string. This will help make it possible to merge borders with titles with spaces and other symbols, without assuming that an empty string is always equivalent to no symbol.
- Default is now derived as
Option::Noneworks correctly.- PartialEq and Eq implementations are updated to treat
Nonethe same as an empty string.- merge_symbol against an empty cell will now just set the symbol rather than calling MergeStrategy::merge with an empty string.
- PartialEq, and Hash are manually implemented instead of being derived, and are updated to treat
Noneequal to an empty string.
887a636 (ci) Override RUSTUP_TOOLCHAIN for the check step by @ognis1205 in #2116
Summary Fixes an issue where the "check" CI jobs for MSRV and stable were unintentionally using the stable toolchain from
rust-toolchain.tomlinstead of the matrix-specified toolchain.Details
- Added
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}to the "check" job in CI configuration.Additional Context
- https://github.com/ratatui/ratatui/pull/2106
- https://discord.com/channels/1070692720437383208/1072879985762762812/1422345357131780177
- https://rust-lang.github.io/rustup/overrides.html#overrides
34baaf1 (ci) Override the toolchain for CI runs by @ognis1205 in #2106
Summary
Fixes an issue where the beta CI jobs were unintentionally using the stable toolchain from
rust-toolchain.tomlinstead of the matrix-specified toolchain. This caused clippy to run against the wrong version.Details
- Added
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}to the CI configurationAdditional Context
- https://discord.com/channels/1070692720437383208/1072879985762762812/1421990770482745415
- https://rust-lang.github.io/rustup/overrides.html#overrides
e48aa9e (ci) Stop publish-alpha from running on forks by @j-g00da in #1916
I can't sleep because every Saturday alpha release fails on my ratatui fork. This should fix my insomnia.
b3f3c9b (ci) Disable running release-plz on forked repositories by @orhun in #1730
See https://github.com/jdssl/ratatui/pull/1#issuecomment-2739366609
eaa4038 (ci) Install pre-built binaries for cargo-rdme by @orhun in #1477
install-actionusescargo-binstallto install the pre-built binaries ofcargo-rdme(which was released in https://github.com/orium/cargo-rdme/releases/tag/v1.4.7).This will make the
check-readmestep faster in CI (now takes only 10 seconds).
e5e2316 (ci) Add check for keeping README.md up-to-date by @orhun in #1473
2ef3583 (ci) Replace cargo-make with a custom cargo-xtask by @joshka in #1461
This removes the need for cargo-make and replaces it with a custom xtask binary. See https://github.com/matklad/cargo-xtask for info.
Rearranges the CI workflow to use the new xtask and simplify which workflows that run.
98df774 (core) Move core types to ratatui-core by @joshka in #1460
The buffer, layout, style, symbols, text, and the top level of widgets modules are moved to ratatui-core. This is the fi
Note truncated.
Crossterm backendGroup and introduce Layout in its place
Terminal is no longer required to compute a layoutSize has been renamed ConstraintFrame instead of a Terminal in order to
avoid mixing draw and render callsdraw on Terminal expects a closure where the UI is built by rendering
widgets on the given FrameWidget trait
draw takes area by valuerender takes a Frame instead of a TerminalSelectableList can have no selected item and the highlight symbol is hidden
in this caseParagraph. Paragraph now expects an iterator
of Text items0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and feedback. Please report any issues you encounter. The p
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and
feedback. Please report any issues you encounter. The primary change is that we've split the crate
into multiple crates. The main crate is now ratatui-core and the widgets are in ratatui-widgets.
This allows for widget crates to depend on a stable core crate, and for the core crate to be used
without widgets.
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
9275d34 (layout) Add Offset::new() constructor by @joshka in #1547
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #1552
ce4856a (widgets) Add the missing constructor to canvas types by @orhun in #1538
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #1581
860e48b (buffer) Buffer::get_pos() now correctly handles index > u16::MAX by @joshka in #1447
ec30390 (canvas) Round coordinates to nearest grid cell by @joshka in #1507
afd1ce1 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #1501
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #1541
a692a6e (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
2892bdd (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #1505
f132fa1 (table) Small readability improvements by @joshka in #1510
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
04e1b32 (layout) Rename cassowary-rs references to cassowary by @miroim in #1448
8f28247 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
fab5321 (widgets) Add example for scrollbar by @orhun in #1545
452366a (widgets) Add example for sparkline by @orhun in #1556
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
15f442a (widgets) Add example for paragraph by @orhun in #1544
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
99ac005 (widgets) Add simple barchart example by @joshka in #1511
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
e411d9e (uncategorized) Add input form example by @joshka in #1551
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
0a47ebd (bencher) Update bencher CLI usage by @epompeii in #1470
eaa4038 (ci) Install pre-built binaries for cargo-rdme by @orhun in #1477
e5e2316 (ci) Add check for keeping README.md up-to-date by @orhun in #1473
2ef3583 (ci) Replace cargo-make with a custom cargo-xtask by @joshka in #1461
98df774 (core) Move core types to ratatui-core by @joshka in #1460
35eba76 (example) Move demo2 to top level folder by @joshka in #1524
5f57d35 (examples) Add colors explorer demo app by @orhun in #1580
a6a1368 (examples) Add calendar explorer demo app by @orhun in #1571
b5f7e44 (examples) Move async example to apps by @joshka in #1503
17316ec (github) Enable sponsorship button by @orhun in #1478
d3f01eb (lint) Ensure lint config is correct by @joshka in #1528
2b7ec5c (widgets) Enable calendar widget as default by @orhun in #1521
d201b8e (xtask) Check lints for only library targets by @orhun in #1531
6f21319 (uncategorized) Rename examples with clashing names by @joshka in #1597
11cbb2b (uncategorized) Use cargo xtask for bacon clippy command by @joshka in #1592
b544e39 (uncategorized) Use clap instead of argh for demo example by @joshka in #1591
9a54198 (uncategorized) Make source files non-executable by @orhun in #1577
357ae7e (uncategorized) Move terminal types to ratatui-core by @joshka in #1530 [breaking]
21e62d8 (uncategorized) Move the demo example to main folder by @joshka in #1523
fbf6050 (uncategorized) Prepare alpha modularization release by @joshka in #1525
e4e95bc (uncategorized) Remove --color always flags from bacon.toml by @joshka in #1502
a41c97b (uncategorized) Move unstable widget refs to ratatui by @joshka in #1491 [breaking]
e7085e3 (uncategorized) Move widgets into ratatui-widgets crate by @joshka in #1474
f1d0a18 (uncategorized) Move ratatui crate into workspace folder by @joshka in #1459
55fb2d2 (uncategorized) Update repo links to ratatui instead of ratatui-org by @joshka in #1458
Full Changelog: https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and feedback. Please report any issues you encounter. The p
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and
feedback. Please report any issues you encounter. The primary change is that we've split the crate
into multiple crates. The main crate is now ratatui-core and the widgets are in ratatui-widgets.
This allows for widget crates to depend on a stable core crate, and for the core crate to be used
without widgets.
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
9275d34 (layout) Add Offset::new() constructor by @joshka in #1547
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #1552
ce4856a (widgets) Add the missing constructor to canvas types by @orhun in #1538
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #1581
860e48b (buffer) Buffer::get_pos() now correctly handles index > u16::MAX by @joshka in #1447
ec30390 (canvas) Round coordinates to nearest grid cell by @joshka in #1507
afd1ce1 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #1501
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #1541
a692a6e (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
2892bdd (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #1505
f132fa1 (table) Small readability improvements by @joshka in #1510
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
04e1b32 (layout) Rename cassowary-rs references to cassowary by @miroim in #1448
8f28247 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
fab5321 (widgets) Add example for scrollbar by @orhun in #1545
452366a (widgets) Add example for sparkline by @orhun in #1556
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
15f442a (widgets) Add example for paragraph by @orhun in #1544
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
99ac005 (widgets) Add simple barchart example by @joshka in #1511
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
e411d9e (uncategorized) Add input form example by @joshka in #1551
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
0a47ebd (bencher) Update bencher CLI usage by @epompeii in #1470
eaa4038 (ci) Install pre-built binaries for cargo-rdme by @orhun in #1477
e5e2316 (ci) Add check for keeping README.md up-to-date by @orhun in #1473
2ef3583 (ci) Replace cargo-make with a custom cargo-xtask by @joshka in #1461
98df774 (core) Move core types to ratatui-core by @joshka in #1460
35eba76 (example) Move demo2 to top level folder by @joshka in #1524
5f57d35 (examples) Add colors explorer demo app by @orhun in #1580
a6a1368 (examples) Add calendar explorer demo app by @orhun in #1571
b5f7e44 (examples) Move async example to apps by @joshka in #1503
17316ec (github) Enable sponsorship button by @orhun in #1478
d3f01eb (lint) Ensure lint config is correct by @joshka in #1528
2b7ec5c (widgets) Enable calendar widget as default by @orhun in #1521
d201b8e (xtask) Check lints for only library targets by @orhun in #1531
6f21319 (uncategorized) Rename examples with clashing names by @joshka in #1597
11cbb2b (uncategorized) Use cargo xtask for bacon clippy command by @joshka in #1592
b544e39 (uncategorized) Use clap instead of argh for demo example by @joshka in #1591
9a54198 (uncategorized) Make source files non-executable by @orhun in #1577
357ae7e (uncategorized) Move terminal types to ratatui-core by @joshka in #1530 [breaking]
21e62d8 (uncategorized) Move the demo example to main folder by @joshka in #1523
fbf6050 (uncategorized) Prepare alpha modularization release by @joshka in #1525
e4e95bc (uncategorized) Remove --color always flags from bacon.toml by @joshka in #1502
a41c97b (uncategorized) Move unstable widget refs to ratatui by @joshka in #1491 [breaking]
e7085e3 (uncategorized) Move widgets into ratatui-widgets crate by @joshka in #1474
f1d0a18 (uncategorized) Move ratatui crate into workspace folder by @joshka in #1459
55fb2d2 (uncategorized) Update repo links to ratatui instead of ratatui-org by @joshka in #1458
Full Changelog: https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and feedback. Please report any issues you encounter. The p
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and
feedback. Please report any issues you encounter. The primary change is that we've split the crate
into multiple crates. The main crate is now ratatui-core and the widgets are in ratatui-widgets.
This allows for widget crates to depend on a stable core crate, and for the core crate to be used
without widgets.
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
9275d34 (layout) Add Offset::new() constructor by @joshka in #1547
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #1552
ce4856a (widgets) Add the missing constructor to canvas types by @orhun in #1538
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #1581
860e48b (buffer) Buffer::get_pos() now correctly handles index > u16::MAX by @joshka in #1447
ec30390 (canvas) Round coordinates to nearest grid cell by @joshka in #1507
afd1ce1 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #1501
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #1541
a692a6e (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
2892bdd (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #1505
f132fa1 (table) Small readability improvements by @joshka in #1510
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
04e1b32 (layout) Rename cassowary-rs references to cassowary by @miroim in #1448
8f28247 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
fab5321 (widgets) Add example for scrollbar by @orhun in #1545
452366a (widgets) Add example for sparkline by @orhun in #1556
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
15f442a (widgets) Add example for paragraph by @orhun in #1544
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
99ac005 (widgets) Add simple barchart example by @joshka in #1511
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
e411d9e (uncategorized) Add input form example by @joshka in #1551
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
0a47ebd (bencher) Update bencher CLI usage by @epompeii in #1470
eaa4038 (ci) Install pre-built binaries for cargo-rdme by @orhun in #1477
e5e2316 (ci) Add check for keeping README.md up-to-date by @orhun in #1473
2ef3583 (ci) Replace cargo-make with a custom cargo-xtask by @joshka in #1461
98df774 (core) Move core types to ratatui-core by @joshka in #1460
35eba76 (example) Move demo2 to top level folder by @joshka in #1524
5f57d35 (examples) Add colors explorer demo app by @orhun in #1580
a6a1368 (examples) Add calendar explorer demo app by @orhun in #1571
b5f7e44 (examples) Move async example to apps by @joshka in #1503
17316ec (github) Enable sponsorship button by @orhun in #1478
d3f01eb (lint) Ensure lint config is correct by @joshka in #1528
2b7ec5c (widgets) Enable calendar widget as default by @orhun in #1521
d201b8e (xtask) Check lints for only library targets by @orhun in #1531
6f21319 (uncategorized) Rename examples with clashing names by @joshka in #1597
11cbb2b (uncategorized) Use cargo xtask for bacon clippy command by @joshka in #1592
b544e39 (uncategorized) Use clap instead of argh for demo example by @joshka in #1591
9a54198 (uncategorized) Make source files non-executable by @orhun in #1577
357ae7e (uncategorized) Move terminal types to ratatui-core by @joshka in #1530 [breaking]
21e62d8 (uncategorized) Move the demo example to main folder by @joshka in #1523
fbf6050 (uncategorized) Prepare alpha modularization release by @joshka in #1525
e4e95bc (uncategorized) Remove --color always flags from bacon.toml by @joshka in #1502
a41c97b (uncategorized) Move unstable widget refs to ratatui by @joshka in #1491 [breaking]
e7085e3 (uncategorized) Move widgets into ratatui-widgets crate by @joshka in #1474
f1d0a18 (uncategorized) Move ratatui crate into workspace folder by @joshka in #1459
55fb2d2 (uncategorized) Update repo links to ratatui instead of ratatui-org by @joshka in #1458
Full Changelog: https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and feedback. Please report any issues you encounter. The p
0.30.0-alpha.1 is a pre-release of the upcoming 0.30.0 release. It is intended for testing and
feedback. Please report any issues you encounter. The primary change is that we've split the crate
into multiple crates. The main crate is now ratatui-core and the widgets are in ratatui-widgets.
This allows for widget crates to depend on a stable core crate, and for the core crate to be used
without widgets.
56d5e05 (bar) Update label and text_value to accept Into<> by @Emivvvvv in #1471 [breaking]
369b18e (barchart) Reduce barchart creation verbosity by @Emivvvvv in #1453
9275d34 (layout) Add Offset::new() constructor by @joshka in #1547
ff729b7 (scrollbar) Support retrieving the current position of state by @orhun in #1552
ce4856a (widgets) Add the missing constructor to canvas types by @orhun in #1538
50ba965 (uncategorized) Add a new RatatuiMascot widget by @Its-Just-Nans in #1584
1d28c89 (uncategorized) Add conversions for anstyle by @joshka in #1581
860e48b (buffer) Buffer::get_pos() now correctly handles index > u16::MAX by @joshka in #1447
ec30390 (canvas) Round coordinates to nearest grid cell by @joshka in #1507
afd1ce1 (canvas) Lines that start outside the visible grid are now drawn by @renesat in #1501
18e70d3 (crossterm) Terminal should keep Bold when removing Dim by @MarSik in #1541
a692a6e (lint) Apply rust 1.84 clippy suggestions by @joshka in #1612
3b13240 (scrollbar) Check for area.is_empty() before rendering by @farmeroy in #1529
f57b696 (span) Dont render control characters by @EdJoPaTo in #1312
2ce958e (table) Allow display of additional table row, if row height > 1 by @Lunderberg in #1452
2892bdd (uncategorized) Rust 1.83 clippy lints by @joshka in #1527
36e2d1b (uncategorized) Add feature(doc_cfg) when generating docs by @joshka in #1506
4d7704f (uncategorized) Make StatefulWidget and Ref work with unsized State by @thscharler in #1505
f132fa1 (table) Small readability improvements by @joshka in #1510
904b0aa (uncategorized) Move symbols to modules by @joshka in #1594
7c8573f (uncategorized) Rearrange selection_spacing code by @raylu in #1540
217c57c (uncategorized) Modularize backends by @orhun in #1508
e461b72 (uncategorized) Move {Stateful,}Widget{,Ref} types into individual files by @joshka in #1479
3ae6bf1 (contributing) Use cargo-xtask for instructions by @orhun in #1509
04e1b32 (layout) Rename cassowary-rs references to cassowary by @miroim in #1448
8f28247 (readme) Correct examples links by @HoKim98 in #1484
260af68 (readme) Include iocraft as an alternative by @kdheepak in #1483
dafb716 (widgets) Add example for grouped barchart by @orhun in #1566
fab5321 (widgets) Add example for scrollbar by @orhun in #1545
452366a (widgets) Add example for sparkline by @orhun in #1556
93ad6b8 (widgets) Update values in chart example by @orhun in #1558
15f442a (widgets) Add example for paragraph by @orhun in #1544
17bba14 (widgets) Move the logo example to widgets by @orhun in #1543
6dd25a3 (widgets) Add example for calendar by @orhun in #1532
99ac005 (widgets) Add simple barchart example by @joshka in #1511
da05957 (uncategorized) Add widget-ref-container example by @joshka in #1603
1798512 (uncategorized) Fix wording in user_input example by @dawedawe in #1611
03066d8 (uncategorized) Fix punctuation in canvas.rs documentation by @dawedawe in #1583
e411d9e (uncategorized) Add input form example by @joshka in #1551
ed071f3 (uncategorized) Add mouse-drawing example by @joshka in #1546
46902f5 (uncategorized) Improve docs for workspace crates by @orhun in #1490
a6b5792 (uncategorized) Fix example link in readme by @thomas-tacquet in #1462
abe2f27 (backend) Change From<T> impls to new backend specific IntoBackend and FromBackend traits by @joshka in #1464 [breaking]
0a47ebd (bencher) Update bencher CLI usage by @epompeii in #1470
eaa4038 (ci) Install pre-built binaries for cargo-rdme by @orhun in #1477
e5e2316 (ci) Add check for keeping README.md up-to-date by @orhun in #1473
2ef3583 (ci) Replace cargo-make with a custom cargo-xtask by @joshka in #1461
98df774 (core) Move core types to ratatui-core by @joshka in #1460
35eba76 (example) Move demo2 to top level folder by @joshka in #1524
5f57d35 (examples) Add colors explorer demo app by @orhun in #1580
a6a1368 (examples) Add calendar explorer demo app by @orhun in #1571
b5f7e44 (examples) Move async example to apps by @joshka in #1503
17316ec (github) Enable sponsorship button by @orhun in #1478
d3f01eb (lint) Ensure lint config is correct by @joshka in #1528
2b7ec5c (widgets) Enable calendar widget as default by @orhun in #1521
d201b8e (xtask) Check lints for only library targets by @orhun in #1531
6f21319 (uncategorized) Rename examples with clashing names by @joshka in #1597
11cbb2b (uncategorized) Use cargo xtask for bacon clippy command by @joshka in #1592
b544e39 (uncategorized) Use clap instead of argh for demo example by @joshka in #1591
9a54198 (uncategorized) Make source files non-executable by @orhun in #1577
357ae7e (uncategorized) Move terminal types to ratatui-core by @joshka in #1530 [breaking]
21e62d8 (uncategorized) Move the demo example to main folder by @joshka in #1523
fbf6050 (uncategorized) Prepare alpha modularization release by @joshka in #1525
e4e95bc (uncategorized) Remove --color always flags from bacon.toml by @joshka in #1502
a41c97b (uncategorized) Move unstable widget refs to ratatui by @joshka in #1491 [breaking]
e7085e3 (uncategorized) Move widgets into ratatui-widgets crate by @joshka in #1474
f1d0a18 (uncategorized) Move ratatui crate into workspace folder by @joshka in #1459
55fb2d2 (uncategorized) Update repo links to ratatui instead of ratatui-org by @joshka in #1458
Full Changelog: https://github.com/ratatui/ratatui/compare/v0.29.0...0.30.0-alpha.1
Nothing published for this version
Nothing published for this version
Use FnOnce instead of FnMut in Group::render
Terminal implements DebugFnOnce instead of FnMut in Group::renderAdd AlternateScreenBackend in termion backend
AlternateScreenBackend in termion backendTermionBackend::with_stdout in order to let an user of the library
provides its own termion structBuffer::pos_ofdebug_assert in Buffer::pos_ofSelectableList to the underlying ListAdd MouseBackend in termion backend to handle scroll and mouse events
MouseBackend in termion backend to handle scroll and mouse eventsItem for items in a Listlog4rs as a dev-dependencies in favor of stderrlogTermionBackend to RawBackend (to distinguish it from the MouseBackend)List to allow passing iterators as itemsTable to allow using iterators as rows and headerTabsborder bitflags to BordersNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per month.