Cell Widget Example
Demonstrates using Cell objects for granular control over individual character grid units.
Sometimes you need to render specific characters with unique styles outside of standard widgets. The Cell primitive allows you to build custom widgets or inject styled content into Tables.
Features Demonstrated
-
Custom Widgets: A
CheckeredBackgroundwidget built by renderingCells in a loop. -
Table Integration: Mixing simple Strings and rich
Cellobjects in a Table row. -
Overlays: Using
RatatuiRuby::Overlayto stack widgets on top of each other. -
Modifiers: Using
rapid_blink,bold, anddimon individual cells.
Hotkeys
-
q / Ctrl+c: Quit
Usage
ruby examples/widget_cell/app.rb
Learning Outcomes
Use this example if you need toβ¦
-
Create a custom widget (like a game board or specialized graph).
-
Style specific cells in a Table (e.g., Green βOKβ, Red βFAILβ).
-
Understand how to position content precisely with
Cell.
