![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.39 to 4.5.40. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.5.40] - 2025-06-09</h2> <h3>Features</h3> <ul> <li>Support quoted ids in <code>arg!()</code> macro (e.g. <code>arg!("check-config": ...)</code>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="cff27dbf57
"><code>cff27db</code></a> chore: Release</li> <li><a href="4ef41249f1
"><code>4ef4124</code></a> docs: Update changelog</li> <li><a href="ca896175c1
"><code>ca89617</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/5848">#5848</a> from jennings/jennings/push-xolwzyoornps</li> <li><a href="99b6391ee9
"><code>99b6391</code></a> fix(complete): Fix PowerShell dynamic completion</li> <li>See full diff in <a href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.39...clap_complete-v4.5.40">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Examples
This folder contains examples that are more application focused.
There are also widget examples in ratatui-widgets
.
You can run these examples using:
cargo run -p example-name
This folder might use unreleased code. Consider viewing the examples in the latest
branch instead
of the main
branch for code which is guaranteed to work with the released ratatui version.
Warning
There may be backwards incompatible changes in these examples, as they are designed to compile against the
main
branch.There are a few workaround for this problem:
- View the examples as they were when the latest version was release by selecting the tag that matches that version. E.g. https://github.com/ratatui/ratatui/tree/v0.26.1/examples.
- If you're viewing this file on GitHub, there is a combo box at the top of this page which allows you to select any previous tagged version.
- To view the code locally, checkout the tag. E.g.
git switch --detach v0.26.1
.- Use the latest [alpha version of Ratatui] in your app. These are released weekly on Saturdays.
- Compile your code against the main branch either locally by adding e.g.
path = "../ratatui"
to the dependency, or remotely by addinggit = "https://github.com/ratatui/ratatui"
For a list of unreleased breaking changes, see [BREAKING-CHANGES.md].
We don't keep the CHANGELOG updated with unreleased changes, check the git commit history or run
git-cliff -u
against a cloned version of this repository.
Design choices
The examples contain some opinionated choices in order to make it easier for newer rustaceans to easily be productive in creating applications:
- Each example has an
App
struct, with methods that implement a main loop, handle events and drawing the UI. - We use
color_eyre
for handling errors and panics. See How to use color-eyre with Ratatui on the website for more information about this. - Common code is not extracted into a separate file. This makes each example self-contained and easy to read as a whole.
Demo
This is the original demo example from the main README. It is available for each of the backends. Source.
Demo2
This is the demo example from the main README and crate page. Source.
Async GitHub
Shows how to fetch data from GitHub API asynchronously. Source.
Calendar Explorer
Shows how to render a calendar with different styles. Source.
Canvas
Shows how to render a canvas with different shapes. Source.
Chart
Shows how to render line, bar, and scatter charts. Source.
Color Explorer
Shows how to handle the supported colors. Source.
Colors-RGB demo
Shows the full range of RGB colors in an animation. Source.
Constraint Explorer
Shows how different constraints can be used to layout widgets. Source.
Constraints
Shows different types of constraints. Source.
Custom Widget
Shows how to create a custom widget that can be interacted with the mouse. Source.
Hyperlink
Shows how to render hyperlinks in a terminal using OSC 8. Source.
Flex
Shows how to use the flex layouts. Source.
Hello World
Shows how to create a simple TUI with a text. Source.
Gauge
Shows different types of gauges. Source.
Inline
Shows how to use the inlined viewport to render in a specific area of the screen. Source.
Input Form
Shows how to render a form with input fields. Source.
Modifiers
Shows different types of modifiers. Source.
Mouse Drawing
Shows how to handle mouse events. Source.
Minimal
Shows how to create a minimal application. Source.
Panic
Shows how to handle panics. Source.
Popup
Shows how to handle popups. Source.
Scrollbar
Shows how to render different types of scrollbars. Source.
Table
Shows how to create an interactive table. Source.
Todo List
Shows how to create a simple todo list application. Source.
Tracing
Shows how to use the tracing crate to log to a file. Source.
User Input
Shows how to handle user input. Source. Source.
Weather
Shows how to render weather data using barchart widget. Source.
WidgetRef Container
Shows how to use WidgetRef
to store widgets in a container. Source.
Advanced Widget Implementation
Shows how to render the Widget
trait in different ways.
How to update these examples?
These gifs were created using VHS. Each example has a
corresponding .tape
file that holds instructions for how to generate the images. Note that the
images themselves are stored in a separate images
git branch to avoid bloating the main
branch.