Expand description
Provides the Terminal
, Frame
and related types.
The Terminal
is the main interface of this library. It is responsible for drawing and
maintaining the state of the different widgets that compose your application.
The Frame
is a consistent view into the terminal state for rendering. It is obtained via
the closure argument of Terminal::draw
. It is used to render widgets to the terminal and
control the cursor position.
§Example
use std::io::stdout;
use ratatui::{prelude::*, widgets::Paragraph};
let backend = CrosstermBackend::new(stdout());
let mut terminal = Terminal::new(backend)?;
terminal.draw(|frame| {
let area = frame.size();
frame.render_widget(Paragraph::new("Hello world!"), area);
})?;
Structs§
CompletedFrame
represents the state of the terminal after all changes performed in the lastTerminal::draw
call have been applied. Therefore, it is only valid until the next call toTerminal::draw
.- A consistent view into the terminal state for rendering a single frame.
- An interface to interact and draw
Frame
s on the user’s terminal. - Options to pass to
Terminal::with_options
Enums§
- Represents the viewport of the terminal. The viewport is the area of the terminal that is currently visible to the user. It can be either fullscreen, inline or fixed.