| Crates.io | relm4-icons |
| lib.rs | relm4-icons |
| version | 0.10.1 |
| created_at | 2023-03-15 21:42:52.618184+00 |
| updated_at | 2025-12-31 13:21:37.457139+00 |
| description | Icons for gtk-rs and Relm4 applications |
| homepage | https://relm4.org |
| repository | https://github.com/Relm4/icons |
| max_upload_size | |
| id | 811003 |
| size | 3,416,451 |
More than 3000 icons, ready for use in your app!
The relm4-icons crate relies on librsvg for rendering SVG icons. Ensure that librsvg is installed on your system before using this crate. The installation process varies depending on your operating system.
# Linux (Debian/Ubuntu)
sudo apt update
sudo apt install librsvg2-dev
# Macos
brew install librsvg
# Windows
gvsbuild build librsvg
You can either use the of the over 3000 shipped icons or your own icons. You can browse the shipped icons using one of the following methods:
For icons from the GNOME icon-development-kit:
For icons from Fluent UI System Icons:
For icons from the previous version of the GNOME development kit:
Note that these legacy GNOME icons are likely to be removed in a future update.
For browsing all shipped icons:
Some icons have overlapping icon names, so the postfix "-alt" is added.
relm4-icons = "0.10"
[build-dependencies]
relm4-icons-build = "0.10"
Add the following to your build.rs:
fn main() {
relm4_icons_build::bundle_icons(
// Name of the file that will be generated at `OUT_DIR`
"icon_names.rs",
// Optional app ID
Some("com.example.myapp"),
// Custom base resource path:
// * defaults to `/com/example/myapp` in this case if not specified explicitly
// * or `/org/relm4` if app ID was not specified either
None::<&str>,
// Directory with custom icons (if any)
None::<&str>,
// List of icons to include
[
"ssd",
"size-horizontally",
"cross-small",
],
);
}
Add this to your initialization code:
mod icon_names {
pub use shipped::*; // Include all shipped icons by default
include!(concat!(env!("OUT_DIR"), "/icon_names.rs"));
}
fn main() {
///...///
relm4_icons::initialize_icons(icon_names::GRESOURCE_BYTES, icon_names::RESOURCE_PREFIX);
}
Use set_icon_name and similar methods to use your icons, for example with
ButtonExt,
StackPage,
MenuButton or
Image.
let button = gtk::Button::default();
button.set_icon_name("plus");
You can also use the icon_names module for extra compile-time generated icon names.
use crate::icon_names;
let button = gtk::Button::default();
button.set_icon_name(icon_names::PLUS);
To add new icons, move them into the icons folder and make sure their file name ends with -symbolic.svg.
Then run the following commands:
cd update_icons
cargo run
Existing icon sets can be updated as submodules with following commands:
git submodule update --remote --checkout
rm -rf build_icons/icons/fluentui-system-icons
rm -rf build_icons/icons/icon-development-kit-www
rm -rf build_icons/icons/icon-development-kit
cd update_icons
cargo run --bin fetch_icons
cargo run
The source code of Relm4 icons is licensed under the terms of both the MIT license and the Apache License (Version 2.0).
icons/icon-development-kit and icons/icon-development-kit-www folders are licensed under the terms of the CC0 license and therefore public domain.icons/fluentui-system-icons folder are licensed under the terms of the MIT license.Both licenses should work for both open source and proprietary applications (without warranty).