Module ratatui::terminal

source ·
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§

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.