pub fn load_icon(role: IconRole, icon_set: &str) -> Option<IconData>Expand description
Load an icon for the given role using the specified icon set.
Resolves icon_set to an IconSet via IconSet::from_name(),
falling back to system_icon_set() if the set string is not
recognized. Then dispatches to the appropriate platform loader or
bundled icon set.
§Dispatch
- Parse
icon_settoIconSet(unknown names fall back to system set) - Platform loader (freedesktop/sf-symbols/segoe-fluent) when
system-iconsenabled - Bundled SVGs (material/lucide) when the corresponding feature is enabled
- Non-matching set:
None(no cross-set fallback)
§Examples
use native_theme::{load_icon, IconRole};
// With material-icons feature enabled
let icon = load_icon(IconRole::ActionCopy, "material");
assert!(icon.is_some());