Cargo Features

[dependencies]
ratatui = { version = "0.30.0-alpha.4", default-features = false, features = ["crossterm", "termion", "termwiz", "std", "serde", "layout-cache", "palette", "scrolling-regions", "macros", "all-widgets", "widget-calendar", "underline-color", "unstable", "unstable-rendered-line-info", "unstable-widget-ref", "unstable-backend-writer", "document-features"] }
default = all-widgets, crossterm, layout-cache, macros, underline-color

The crate provides a set of optional features that can be enabled in your Cargo.toml file.

By default, we enable the crossterm backend as this is a reasonable choice for most applications as it is supported on Linux/Mac/Windows systems. We also enable the underline-color feature which allows you to set the underline color of text, the macros feature which provides some useful macros and layout-cache which speeds up layout cache calculations in std-enabled environments.

crossterm default = std

Generally an application will only use one backend, so you should only enable one of the following features: enables the CrosstermBackend backend and adds a dependency on crossterm.

Enables ratatui-crossterm

termion = std

enables the TermionBackend backend and adds a dependency on termion.

Enables ratatui-termion

termwiz = std

enables the TermwizBackend backend and adds a dependency on termwiz.

Enables ratatui-termwiz

std crossterm layout-cache termion? termwiz?

enables std

Enables std of ratatui-core and ratatui-widgets

serde

The following optional features are available for all backends: enables serialization and deserialization of style and color types using the serde crate. This is useful if you want to save themes to a file.

Enables serde, serde of ratatui-core, ratatui-widgets, optional ratatui-crossterm, optional ratatui-termion, and optional ratatui-termwiz

layout-cache default = std

enables layout cache

Enables layout-cache of ratatui-core

palette

enables conversions from colors in the palette crate to Color.

Enables palette, palette of ratatui-core

scrolling-regions

Use terminal scrolling regions to make some operations less prone to flickering. (i.e. Terminal::insert_before).

Enables scrolling-regions of ratatui-core, optional ratatui-crossterm, optional ratatui-termion, and optional ratatui-termwiz

macros default

enables the macros module which provides some useful macros for creating spans, lines, text, and layouts

Enables ratatui-macros

all-widgets default = widget-calendar

enables all widgets.

widget-calendar all-widgets

Widgets that add dependencies are gated behind feature flags to prevent unused transitive dependencies. The available features are: enables the calendar widget module.

Enables calendar of ratatui-widgets

underline-color default

The following optional features are only available for some backends:

Enables the backend code that sets the underline color.
Underline color is only supported by the Crossterm and Termwiz backends, and is not supported on Windows 7.

Enables underline-color of ratatui-core, optional ratatui-crossterm, and optional ratatui-termwiz

unstable = unstable-backend-writer, unstable-rendered-line-info, unstable-widget-ref

The following features are unstable and may change in the future:

Enable all unstable features.

unstable-rendered-line-info unstable?

Enables the Paragraph::line_count Paragraph::line_width methods which are experimental and may change in the future. See Issue 293 for more details.

Enables unstable-rendered-line-info of ratatui-widgets

unstable-widget-ref unstable?

enables the WidgetRef and StatefulWidgetRef traits which are experimental and may change in the future.

unstable-backend-writer unstable?

Enables getting access to backends' writers.

Enables unstable-backend-writer of optional ratatui-crossterm and optional ratatui-termion

Features from optional dependencies

document-features implicit feature

Enables document-features

document-features:

Extract documentation for the feature flags from comments in Cargo.toml