tui-popup 0.2.0

A simple popup for ratatui
Documentation

tui-popup

Crates.io badge License badge Docs.rs badge Deps.rs badge Discord badge

A popup widget for Ratatui

The popup widget is a simple widget that renders a popup in the center of the screen.

Example

use ratatui::prelude::*;
use tui_popup::Popup;

fn render_popup(frame: &mut Frame) {
    let popup = Popup::new("tui-popup demo", "Press any key to exit")
       .style(Style::new().white().on_blue());
    frame.render_widget(popup.to_widget(), frame.size());
}

demo

Features

  • automatically centers
  • automatically sizes to content
  • style popup
  • configure size / position
  • handle text wrapping in body -> size
  • set border set / style
  • mouse / keyboard events for moving
  • mouse / keyboard events for close action