Icons
Built-in chrome uses SVG assets from the crate. Register them once, then draw them as GPUI svg elements.
Register the assets
HeroGpuiAssets embeds the herogpui/icons/*.svg files used by checkmarks, chevrons, clear buttons, and other built-in chrome. Pass it to with_assets before you run the app:
1gpui_platform::application()
2 .with_assets(HeroGpuiAssets)
3 .run(|cx| { /* open windows */ });If your app already has an asset source, wrap it so both sets resolve. Components keep working, and your own paths stay available:
1gpui_platform::application()
2 .with_assets(HeroGpuiAssets::with_fallback(MyAppAssets))
3 .run(|cx| { /* both icon sets resolve */ });Draw an icon
Paths live on herogpui::prelude::icons. Size and color are GPUI style methods — icons follow the theme when you read cx.colors():
1use herogpui::prelude::{icons, ActiveTheme};
2use gpui::{px, svg};
3
4svg()
5 .size(px(16.))
6 .path(icons::PLUS)
7 .text_color(cx.colors().foreground)Put the svg ahead of a label when you compose a Button. Icon-only buttons use is_icon_only(true) so the control stays square.
No icon font
There is no webfont or CSS class for icons. If a glyph is missing, add an SVG to your own asset source and pointsvg().path(..) at it.