Expand description
Extensible zone and plugin rendering system for ratatui.
ratatui-zonekit lets plugins own UI zones in a ratatui application.
Plugins declare what they need (tabs, panels, overlays), and the host
application decides where and how to render them.
§Design Principles
- Request, don’t mutate: plugins request zones, the host approves.
- Safe delegation: plugin renders are wrapped in
catch_unwind. - Theme-agnostic: works with any styling system (themekit, raw Style, custom).
- Model B: plugins declare intent, host renders. Plugins never touch
Frame.
§Quick Start
use ratatui_zonekit::{ZonePlugin, ZoneId, RenderContext};
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
struct MyPlugin;
impl ZonePlugin for MyPlugin {
fn id(&self) -> &str { "my-plugin" }
fn render(&self, _zone_id: ZoneId, _ctx: &RenderContext, area: Rect, buf: &mut Buffer) -> bool {
use ratatui::widgets::{Paragraph, Widget};
Paragraph::new("Hello from plugin!").render(area, buf);
true
}
}Structs§
- Render
Context - Context passed to a plugin during rendering.
- Safe
Renderer - Safe renderer that isolates plugin panics.
- ZoneId
- Unique identifier for a zone, assigned by the host.
- Zone
Registry - Manages zone allocation and plugin ownership.
- Zone
Request - A plugin’s request to create or own a zone.
- Zone
Spec - A resolved zone — the host’s response to a
ZoneRequest.
Enums§
- Registration
Result - Registration result — whether a zone request was granted or denied.
- Zone
Event - Events delivered to zone plugins.
- Zone
Hint - Where a plugin wants its zone to appear.
Traits§
- Zone
Plugin - A plugin that owns one or more zones in the TUI.