| Crates.io | heroicons |
| lib.rs | heroicons |
| version | 0.2.0 |
| created_at | 2025-10-07 08:58:28.1068+00 |
| updated_at | 2025-10-20 21:37:46.51248+00 |
| description | Easily include Heroicons SVGs in Rust |
| homepage | https://github.com/dvaergiller/heroicons-rs |
| repository | https://github.com/dvaergiller/heroicons-rs |
| max_upload_size | |
| id | 1871365 |
| size | 2,374,571 |
A Rust crate providing access to the beautiful hand-crafted SVG icons from Heroicons, created by the makers of Tailwind CSS.
This crate offers Heroicons through a structured Icon system:
IconName and Variantto_string()hypertext frameworkAll icons are available in multiple variants:
use heroicons::{Icon, icon_name::*, icon_variant::*};
// Create icons with different variants
let home_icon = Icon {
name: Home,
variant: Outline,
..Default::default()
};
let user_icon = Icon {
name: User,
variant: Solid,
..Default::default()
};
// Convert to SVG string
let svg_string = home_icon.to_string();
// Use the SVG string in HTML templates, web frameworks, etc.
The hypertext feature is enabled by default. Use the <Icon> component with the rsx! macro:
use heroicons::{Icon, icon_name::*, icon_variant::*};
use hypertext::prelude::*;
let page = rsx! {
<div>
<Icon name=(Home) variant=(Outline) ../>
<Icon name=(User) variant=(Solid) ../>
</div>
}.render();
Or with the maud! macro:
use heroicons::{Icon, icon_name::*, icon_variant::*};
use hypertext::prelude::*;
let page = maud! {
div {
Icon name=(Home) variant=(Outline) ..;
Icon name=(User) variant=(Solid) ..;
}
}.render();
hypertext feature for component supporthypertext: Adds component functions in the hypertext modulesimd: Enables SIMD optimizations for HTML parsing