Categories: None [Edit]
ratatui_ruby
== Terminal UIs, the Ruby Way
RatatuiRuby[https://rubygems.org/gems/ratatui_ruby] is a RubyGem built on
Ratatui[https://ratatui.rs], a leading TUI library written in
Rust[https://rust-lang.org]. You get native performance with the joy of Ruby.
gem install ratatui_ruby
{rdoc-image:https://ratatui-ruby.dev/hero.gif}[https://www.ratatui-ruby.dev/docs/v0.10/examples/app_cli_rich_moments/README_md.html]
=== Rich Moments
Add a spinner, a progress bar, or an inline menu to your CLI script. No
full-screen takeover. Your terminal history stays intact.
==== Inline Viewports
Standard TUIs erase themselves on exit. Your carefully formatted CLI output
disappears. Users lose their scrollback.
Inline viewports solve this. They occupy a fixed number of lines, render
rich UI, then leave the output in place when done.
Perfect for spinners, menus, progress indicators—any brief moment of richness.
require "ratatui_ruby"
RatatuiRuby.run(viewport: :inline, height: 1) do |tui|
until connected?
status = tui.paragraph(text: "\#{spin} Connecting...")
tui.draw { |frame| frame.render_widget(status, frame.area) }
end
end
=== Build Something Real
Full-screen applications with {keyboard and mouse input}[https://www.ratatui-ruby.dev/docs/v0.10/examples/app_all_events/README_md.html]. The managed loop
sets up the terminal and restores it on exit, even after crashes.
RatatuiRuby.run do |tui|
loop do
tui.draw do |frame|
frame.render_widget(
tui.paragraph(text: "Hello, RatatuiRuby!", alignment: :center),
frame.area
)
end
case tui.poll_event
in { type: :key, code: "q" } then break
else nil
end
end
end
==== Widgets included:
[Layout]
{Block}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_block/README_md.html],
{Center}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_center/README_md.html],
{Clear (Popup, Modal)}[https://www.ratatui-ruby.dev/docs/v0.10/examples/widget_popup/README_md.html],
{...
Total
Ranking: 56,602 of 191,066
Downloads: 19,276
Daily
Ranking: 4,713 of 191,018
Downloads: 248
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
| Rank | Downloads | Name |
|---|---|---|
| 179,300 | 1,798 | rooibos |
| 182,323 | 1,217 | claude-worktree |
| 182,466 | 1,195 | anima-core |
| 183,501 | 1,032 | ratatui_ruby-tea |
| 185,720 | 745 | solid_queue_tui |
| 188,482 | 423 | writers_room |
| 189,316 | 321 | ratamin |
Owners
| # | Gravatar | Handle |
|---|---|---|
| 1 | Kerrick |