pub struct Theme {Show 15 fields
pub border_focused: Style,
pub border_unfocused: Style,
pub border_popup: Style,
pub border_error: Style,
pub border_warning: Style,
pub tab_active: Style,
pub tab_inactive: Style,
pub selection: Style,
pub shortcut_key: Style,
pub shortcut_indicator: Style,
pub section_header: Style,
pub body: Style,
pub hint: Style,
pub separator: Style,
pub success: Style,
}Expand description
Color and style palette for tui-kit components.
§Usage
Use Theme::native() (the default) for a palette that adapts to the
user’s terminal color scheme, or Theme::dark() for a fixed
lazygit-inspired dark palette.
§Extending for your app
Wrap Theme in your own struct for app-specific semantic roles:
pub struct AppTheme {
pub base: Theme, // passed to all tui-kit calls
pub my_semantic: Style, // app-specific roles
}
impl AppTheme {
pub fn native() -> Self {
Self {
base: Theme::native(),
my_semantic: Style::default().fg(Color::LightGreen),
}
}
}Theme is Copy so it is cheap to pass by value or reference.
Fields§
§border_focused: StyleBorder of the currently-focused interactive panel.
border_unfocused: StyleBorder of passive / display-only panels.
border_popup: StyleBorder of floating popups (always treated as focused).
border_error: StyleBorder of error popups.
border_warning: StyleBorder of warning popups.
tab_active: StyleLabel of the active tab.
tab_inactive: StyleLabel of an inactive tab.
selection: StyleStyle applied to the selected row in a list (fg + bg combined).
shortcut_key: StyleInline keyboard shortcut labels (e.g. “Enter”, “Tab”).
shortcut_indicator: StyleThe -[n]- digit indicator shown in widget titles.
section_header: StyleSection / group headers inside popups.
body: StyleNormal body text.
hint: StyleDimmed hint and footer text.
separator: StyleSeparator lines (─ characters).
success: StylePositive / success signal (e.g. toast success, CI pass).
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn native() -> Self
pub fn native() -> Self
16-color native palette — adapts to the user’s terminal color scheme.
Uses only the 16 named ANSI colors so the result respects the terminal theme (dark/light, Solarized, Nord, etc.).
| Role | Color |
|---|---|
| Accent / focused | LightBlue |
| Tabs / headers | LightBlue |
| Shortcuts | Yellow |
| Selection | Black on LightBlue |
| Positive signal | LightGreen |
| Negative signal | LightRed |
| Muted / hints | DarkGray |
Sourcepub fn dark() -> Self
pub fn dark() -> Self
Fixed dark palette with green accents — does not adapt to terminal theme.
Use when you know the terminal has a dark background and want a consistent lazygit-inspired look regardless of terminal settings.
| Role | Color |
|---|---|
| Accent / focused | Green + Bold |
| Unfocused border | White |
| Active tab | Green + Bold |
| Selection | White on Blue + Bold |
| Shortcut keys | Yellow |
| Section headers | Cyan + Bold |
| Hints | DarkGray |
Trait Implementations§
impl Copy for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more