ratatui/examples
2023-09-25 23:22:14 -07:00
..
demo feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
demo2 feat(examples): add demo2 example (#500) 2023-09-21 01:47:23 -07:00
barchart.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
barchart.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
block.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
block.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
calendar.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
calendar.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
canvas.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
canvas.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
chart.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
chart.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
colors.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
colors.tape docs(examples): Add color and modifiers examples (#345) 2023-08-11 01:36:12 +00:00
colors_rgb.rs feat(examples): add demo2 example (#500) 2023-09-21 01:47:23 -07:00
colors_rgb.tape docs(examples): add colors_rgb example (#476) 2023-09-09 17:30:41 -07:00
custom_widget.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
custom_widget.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
demo.tape docs(examples): fix the instructions for generating demo GIF (#442) 2023-08-27 20:50:33 +00:00
demo2-social.tape feat(examples): add demo2 example (#500) 2023-09-21 01:47:23 -07:00
demo2.tape feat(examples): add demo2 example (#500) 2023-09-21 01:47:23 -07:00
gauge.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
gauge.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
generate.bash docs(examples): move example gifs to github (#460) 2023-09-02 14:15:07 -07:00
hello_world.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
hello_world.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
inline.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
inline.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
layout.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
layout.tape docs(examples): show layout constraints (#393) 2023-08-13 07:38:43 +00:00
list.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
list.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
modifiers.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
modifiers.tape docs(examples): Add color and modifiers examples (#345) 2023-08-11 01:36:12 +00:00
panic.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
panic.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
paragraph.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
paragraph.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
popup.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
popup.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
README.md feat(examples): add demo2 example (#500) 2023-09-21 01:47:23 -07:00
scrollbar.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
scrollbar.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
sparkline.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
sparkline.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
table.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
table.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
tabs.rs docs(tabs): add documentation to Tabs (#535) 2023-09-25 23:22:14 -07:00
tabs.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00
user_input.rs feat(frame)!: Remove generic Backend parameter (#530) 2023-09-25 22:30:36 -07:00
user_input.tape docs(examples): add descriptions and update theme (#460) 2023-09-02 14:15:03 -07:00

Examples

These gifs were created using Charm VHS.

VHS has a problem rendering some background color transitions, which shows up in several examples below. See https://github.com/charmbracelet/vhs/issues/344 for more info. These problems don't occur in a terminal.

Demo

This is the previous demo example from the main README. It is available for each of the backends. Source: demo.rs.

cargo run --example=demo --features=crossterm
cargo run --example=demo --no-default-features --features=termion
cargo run --example=demo --no-default-features --features=termwiz

Demo

Hello World

This is a pretty boring example, but it contains some good documentation on writing tui apps. Source: hello_world.rs.

cargo run --example=hello_world --features=crossterm

Hello World

Barchart

Demonstrates the BarChart widget. Source: barchart.rs.

cargo run --example=barchart --features=crossterm

Barchart

Block

Demonstrates the Block widget. Source: block.rs.

cargo run --example=block --features=crossterm

Block

Calendar

Demonstrates the Calendar widget. Source: calendar.rs.

cargo run --example=calendar --features=crossterm widget-calendar

Calendar

Canvas

Demonstrates the Canvas widget and related shapes in the canvas module. Source: canvas.rs.

cargo run --example=canvas --features=crossterm

Canvas

Chart

Demonstrates the Chart widget. Source: chart.rs.

cargo run --example=chart --features=crossterm

Chart

Colors

Demonstrates the available Color options. These can be used in any style field. Source: colors.rs.

cargo run --example=colors --features=crossterm

Colors

Colors (RGB)

Demonstrates the available RGB Color options. These can be used in any style field. Source: colors_rgb.rs.

cargo run --example=colors_rgb --features=crossterm

Colors RGB

Custom Widget

Demonstrates how to implement the Widget trait. Source: custom_widget.rs.

cargo run --example=custom_widget --features=crossterm

Custom Widget

Gauge

Demonstrates the Gauge widget. Source: gauge.rs.

[!NOTE] The backgrounds render poorly when we generate this example using VHS. This problem doesn't generally happen during normal rendering in a terminal. See vhs#344 for more details.

cargo run --example=gauge --features=crossterm

Gauge

Inline

Demonstrates the Inline Viewport mode for ratatui apps. Source: inline.rs.

cargo run --example=inline --features=crossterm

Inline

Layout

Demonstrates the Layout and interaction between each constraint. Source: layout.rs.

cargo run --example=layout --features=crossterm

Layout

List

Demonstrates the List widget. Source: list.rs.

cargo run --example=list --features=crossterm

List

Modifiers

Demonstrates the style Modifiers. Source: modifiers.rs.

cargo run --example=modifiers --features=crossterm

Modifiers

Panic

Demonstrates how to handle panics by ensuring that panic messages are written correctly to the screen. Source: panic.rs.

cargo run --example=panic --features=crossterm

Panic

Paragraph

Demonstrates the Paragraph widget. Source: paragraph.rs

cargo run --example=paragraph --features=crossterm

Paragraph

Popup

Demonstrates how to render a widget over the top of previously rendered widgets using the Clear widget. Source: popup.rs.

cargo run --example=popup --features=crossterm

[!NOTE] The background renders poorly after the popup when we generate this example using VHS. This problem doesn't generally happen during normal rendering in a terminal. See vhs#344 for more details.

Popup

Scrollbar

Demonstrates the Scrollbar widget. Source: scrollbar.rs.

cargo run --example=scrollbar --features=crossterm

Scrollbar

Sparkline

Demonstrates the Sparkline widget. Source: sparkline.rs.

[!NOTE] The background renders poorly in the second sparkline when we generate this example using VHS. This problem doesn't generally happen during normal rendering in a terminal. See vhs#344 for more details.

cargo run --example=sparkline --features=crossterm

Sparkline

Table

Demonstrates the Table widget. Source: table.rs.

cargo run --example=table --features=crossterm

Table

Tabs

Demonstrates the Tabs widget. Source: tabs.rs.

cargo run --example=tabs --features=crossterm

Tabs

User Input

Demonstrates one approach to accepting user input. Source user_input.rs.

[!NOTE] Consider using tui-textarea or tui-input crates for more functional text entry UIs.

cargo run --example=user_input --features=crossterm

User Input