More than 800 icons, ready for use in your app!
Use one of the following methods:
For each icon you want to use, you can add a feature flag. Only the icons you specify will be compiled into your application.
toml
relm4-icons = { version = "0.6.0-beta.4", features = ["<icon1>", "<icon2>", "<icon3>..."] }
To enable the plus
and minus
icons use:
toml
relm4-icons = { version = "0.6.0-beta.4", features = ["plus", "minus"] }
The file ending
-symbolic.svg
isn't part of the icon name.
Add this somewhere in your initialization code (after initializing RelmApp
or GTK).
rust
relm4_icons::initialize_icons();
Use set_icon_name
and similar methods to use your icons, for example with
ButtonExt
,
StackPage
,
MenuButton
or
Image
.
rust
let button = gtk::Button::default();
button.set_icon_name("plus");
You can also use the icon_name
module for extra compile-time checking of icon names.
```rust use relm4icons::iconname;
let button = gtk::Button::default(); button.seticonname(icon_name::PLUS); ```
icons
folderTo add new icons, move them into the icons
folder and make sure their file name ends with -symbolic.svg
.
Then run the following commands:
sh
cd update_icons
cargo run