Expand description
Widgets, themes, and optional components for egui.
This crate is not a drop-in replacement for stock egui widgets. It ships a themed widget set, a palette of built-in looks, a live theme editor, and a few higher-level components (credentials form, QR image, Linux QR scanner).
There are no crate-root re-exports. Import from the modules:
use egui_elements::theme::{Theme, ThemeKind};
use egui_elements::widgets::{Button, ComboBox, Label, Modal, SecureTextEdit, Window};
use egui_elements::utils::theme_switcher;§Quick start
use egui::{Context, Ui};
use egui_elements::theme::{Theme, ThemeKind};
use egui_elements::widgets::Button;
fn ui(ctx: &Context, ui: &mut Ui) {
let mut theme = Theme::new(ThemeKind::TokyoNight);
theme.install(ctx);
if ui.add(Button::new("Save")).clicked() {
// …
}
}Custom widgets pick up visuals from the installed
Theme. You can still override a single widget
with .visuals(...).
§Modules
theme/themes— palettes,ThemeKind, installwidgets—Button,Label,ComboBox,Modal,SecureTextEdit,MultiLabel,Windowcomponents— feature-gated composites (secure-types,qr-image,qr-scanner)editor— liveThemeEditorutils—theme_switcher, HSLA helpersoverlay— dimming overlay for stacked windowsvisuals— per-widget chrome (ButtonVisuals,TextEditVisuals, …)
§Features
| Feature | What it enables |
|---|---|
serde | Serialize / Deserialize on theme types; egui/serde |
secure-types | SecureString buffers, credentials form, virtual keyboard |
qr-image | Encode a string as a QR Image |
qr-scanner | Linux screen-capture QR scanner (xcap + rqrr-zeroize) |
elegance | Push the current palette into egui-elegance |
full | All of the above |
Run the showcase with:
cargo run --example demo --features fullSee the crate README for system packages required by qr-scanner.
ComboBox and Window have
the same names as egui::ComboBox and egui::Window. Import this crate’s
widgets after use egui::*, or alias one of them.
Re-exports§
pub use overlay::OverlayManager;pub use theme::Theme;pub use theme::ThemeKind;pub use widgets::Button;pub use widgets::ComboBox;pub use widgets::Label;pub use widgets::Modal;pub use widgets::MultiLabel;pub use widgets::Window;
Modules§
- components
- Higher-level composites built on the themed widgets.
- editor
- Live theme editor window.
- overlay
- Full-screen dimming used when stacking windows or modals.
- theme
- Installed look: palette, typography, frames, and per-widget visuals.
- themes
- Built-in palettes.
- utils
- Helpers: theme switcher, HSLA colors, and interactive frames.
- visuals
- Per-widget visuals stored on
Themeand optionally overridden on a single widget via.visuals(...). - widgets
- Themed widgets that read visuals from an installed
Theme.