tui-popup
A [Ratatui] widget to show a snappy popup overlay. Part of the tui-widgets suite by Joshka.

The popup widget is a simple widget that renders a popup in the center of the screen.
GitHub Repository · API Docs · Examples · Changelog · Contributing
Installation
cargo add tui-popup
Usage
Build a Popup with content and render it over your frame.
use ;
use Frame;
use Popup;
State
The widget supports storing the position of the popup in PopupState. This is experimental and
the exact API for this will likely change.
use ;
use ;
use Frame;
use ;
The popup can automatically handle being moved around by the mouse, by passing in the column and row of mouse up, down, or drag events.
use ;
use PopupState;
The popup also supports rendering arbitrary widgets by implementing [KnownSize] (or wrapping
them with [KnownSizeWrapper]). This makes it possible to support wrapping and scrolling in a
Paragraph widget, or scrolling any amount of widgets using tui-scrollview.
use *;
use ;
use Paragraph;
use ;

Features
- automatically centers
- automatically sizes to content
- style popup
- move the popup (using state)
- handle mouse events for dragging
- move to position
- resize
- set border set / style
- add close button
- add nicer styling of header etc.
- configure text wrapping in body to conform to a specific size
More widgets
For the full suite of widgets, see tui-widgets.
License
Copyright (c) Josh McKinney
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.