| Crates.io | lucide-svg |
| lib.rs | lucide-svg |
| version | 0.1.1 |
| created_at | 2025-07-31 00:00:24.783588+00 |
| updated_at | 2025-08-05 15:15:19.069745+00 |
| description | Lucide static icons in Rust |
| homepage | |
| repository | https://github.com/KrisNK/lucide-svg |
| max_upload_size | |
| id | 1774205 |
| size | 51,678 |
Lucide static icons in Rust.
When you build your project with lucide-svg, a build script runs. It downloads all SVG icons, from the latest lucid-static unpkg CDN, and generates a struct for each icon.
Furthermore, each struct implements Debug, Display, Clone, Copy, and, the crate defined trait, LucideIcon.
use lucide_svg::LucideIcon;
use lucide_svg::House;
// all icons implement the `LucideIcon` trait
struct Icon(Box<dyn LucideIcon>);
fn foo(icon: impl LucideIcon) -> Icon {
Icon(Box::new(icon))
}
fn make_house() -> Icon {
// all icons implement `std::fmt::Display` (and Debug too)
println!("house icon: {}", House);
foo(House)
}