-
Notifications
You must be signed in to change notification settings - Fork 247
Cursive vs ratatui
Cursive and ratatui are both making TUIs easier to write, and while they may look like competitors, they focus on different key aspects.
Both libraries are great! Both also work on linux, macOS and windows.
If you're writing a full-screen terminal UI, using one of these libraries will be much easier than using ncurses or another low-level terminal handling library.
Ratatui uses an "immediate-mode"-UI: the user handles the event loop, the application state, and re-draws the entire UI on each iteration.
It does not handle input; users should use another library (like crossterm) or use stdin
directly.
As a result, it is well suited for flat dashboards, and other often-refreshing applications with little interaction.
Cursive uses a more declarative UI: the user defines the layout, then cursive handles the event loop. Cursive also handles most input (including mouse clicks), and forwards events to the currently focused view. User-code is more focused on "events" than on keyboard input.
It is well suited for more complex applications, with nested view trees, menus and pop-up windows.