class RatatuiRuby::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
  ]
)