Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tiborgats/native-theme

native-theme

Crates.io docs.rs CI License: MIT OR Apache-2.0 OR 0BSD MSRV: 1.94.0

Cross-platform native theme loading for Rust GUI applications. Reads OS themes on Linux (KDE, GNOME), macOS, and Windows, or loads any of 16 bundled presets (Catppuccin, Nord, Dracula, Tokyo Night, …), and hands your UI code a fully populated ResolvedTheme.

gpui theme switching

Iced theme switching

Pick your path

Your GUI framework Add this crate
gpui native-theme-gpui
iced native-theme-iced
Writing a new framework connector native-theme directly

The connectors pull native-theme in transitively, so you only add one dependency for the common case.

How the 5 crates fit together

native-theme crate relations

Core concepts

  • Theme — the sparse, TOML-shaped definition a preset or file loads. Fields are Option<T> because presets may omit almost anything.
  • ResolvedTheme — the fully-populated variant Theme::resolve(mode) produces. Every field has a value. Your UI code reads from this.
  • Preset — a named, bundled theme (e.g. catppuccin-mocha, kde-breeze, macos-sonoma). Load with Theme::preset("name").
  • Connector — a small crate that maps ResolvedTheme onto a GUI framework's native theming system. You depend on one of these.

See it in action

  • gpui — full widget gallery with live theme switching
  • iced — full widget gallery with live theme switching

Icon sets

Material spinner      Lucide spinner

Semantic icon roles (like StatusBusy or DialogSuccess) map to platform-appropriate glyphs:

  • Material Symbols and Lucide bundled for offline use
  • freedesktop on Linux — reads the active icon theme (Breeze, Adwaita, …)
  • SF Symbols on macOS, Segoe Fluent Icons on Windows (platform lookups)
  • Animated indicators respect the OS prefers-reduced-motion preference

See native-theme crate docs for the icon-loading API.

Project docs

License

Licensed under any of

at your option.

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 triple licensed as above, without any additional terms or conditions.

About

Toolkit-agnostic Rust crate for unified OS theme data

Resources

License

0BSD and 2 other licenses found

Licenses found

0BSD
LICENSE-0BSD
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors