Skip to content

tdymel/pictogram

Repository files navigation

Pictogram

Pictogram resolves icons at compile time using data stored in the manifest directory. During compilation an icon is looked up and baked into your application. This bypasses compilation penalties as the entire icon data does not have to be compiled by rustc.

Features

  • NOT vibe coded.
  • Type-Safe: If an icon can't be resolved, it will lead to a compilation error.
  • Compile-Time: Icons are baked into your code at compile time.
  • Only pay for what you need: Only compile the icons, you actually use.
  • Framework independent: Although, there is an adapter for dioxus.

How to use it

# By default all features are enabled
pictogram = { version = "*", features=["material"] }
let svg = pictogram::svg!(pictogram::material::action_123::filled);
println!("{}", svg);

Dioxus adapter

The adapter is available here.

rsx! {
    Icon {
        icon: pictogram::svg!(pictogram::material::action_123::filled),
        width: 48,
        height: 48,
        ... other attributes of your liking ...
    }
}

Supported libraries

More libraries are going to be added soon.

Library Feature Crate
Material design icons material pictogram-icons-material
Bootstrap bootstrap pictogram-icons-bootstrap

License

This project is licensed under either

at your option.

About

A compile time svg icon resolver for rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors

Languages