class RatatuiRuby::Widgets::Overlay
Stacks widgets on top of each other.
Terminal interfaces are 2D grids, but complex UIs require depth. You need to float modals over text, or place a status bar on top of a map.
This widget manages the Z-axis. It renders a list of widgets sequentially into the same area. Later widgets draw over earlier ones (Painter’s Algorithm).
Use overlays to compose complex scenes. Combine backgrounds, main content, and floating elements.
Examples
Overlay.new( layers: [ BackgroundMap.new, StatusBar.new, # Draws over map ModalDialog.new # Draws over everything ] )
Attributes
The stack of widgets to render.
Rendered from index 0 to N. Index N is the top-most layer.
Public Class Methods
Source
# File lib/ratatui_ruby/widgets/overlay.rb, line 50 def initialize(layers: []) super end