Skip to main content

Module theme

Module theme 

Source
Expand description

Color theme system for consistent styling across all widgets.

The theme system provides a centralized ColorPalette with semantic color roles that every widget style can be derived from. Existing APIs are untouched – *Style::default() still works identically.

§Quick Start

use ratatui_interact::theme::Theme;
use ratatui_interact::components::ButtonStyle;

// Use the dark theme (matches existing defaults)
let theme = Theme::dark();
let button_style: ButtonStyle = theme.style();

// Or use the light theme
let light = Theme::light();
let button_style: ButtonStyle = light.style();

§Applying to Widgets

Every widget with a .style() method also has a .theme() convenience method:

let button = Button::new("OK", &state).theme(&theme);
let input = Input::new(&input_state).theme(&theme);

Structs§

ColorPalette
A semantic color palette with ~30 color roles.
Theme
A named theme with a ColorPalette.