#egui #switch #widgets #dark-light

egui-theme-switch

A pretty theme switch for your egui app

3 unstable releases

0.2.0 Sep 26, 2024
0.1.1 Jul 18, 2024
0.1.0 Jul 16, 2024

#176 in GUI

Download history 163/week @ 2024-07-17 38/week @ 2024-07-24 27/week @ 2024-07-31 9/week @ 2024-08-07 3/week @ 2024-08-14 3/week @ 2024-08-21 19/week @ 2024-08-28 7/week @ 2024-09-04 17/week @ 2024-09-11 20/week @ 2024-09-18 221/week @ 2024-09-25 34/week @ 2024-10-02 98/week @ 2024-10-09 34/week @ 2024-10-16 15/week @ 2024-10-23 22/week @ 2024-10-30

172 downloads per month

MIT/Apache

45KB
525 lines

egui-theme-switch

Docs Crate Version

A very pretty theme switch widget for your egui app. It allows you to choose between dark, light and follow system.

Screenshot of a tri-state switch with three options: follow system, dark, light

Example

use egui::ThemePreference;
use egui_theme_switch::{ThemeSwitch, global_theme_switch};

// A switch for egui's global theme preference:
global_theme_switch(ui);

// ... or alternatively:
let mut preference = ThemePreference::System;
if ui.add(ThemeSwitch::new(&mut preference)).changed() {
    // ...
}

Interactive Demo

Docs

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4–9MB
~84K SLoC