This crate makes it easy to use SVG icons from the following collections (more may be added in the future):
- TODO: Bootstrap - MIT License
- TODO: Font Awesome - CC BY 4.0 License
- Regular
- Solid
- Heroicons - MIT License
- Solid
- Outline
- Mini Solid
- TODO: Lipis Flag Icons* - MIT License
- Lucide - ISC License
- TODO: Octicons - MIT License
[dependencies]
leptos_icons = { git = "https://github.com/bankai-labs/leptos-icons", features = [
"HeroiconsOutlineFolder",
"HeroiconsOutlineChevronRight",
"HeroiconsOutlineEllipsisVertical"
] }
Then, add an <Icon>
component with the corresponding path.
use leptos_icons::{Icon, HeroiconsOutlineFolder, HeroiconsOutlineChevronRight, HeroiconsOutlineEllipsisVertical};
view!{
<>
<Icon class="w-5 h-5 mr-3" path={HeroiconsOutlineFolder} />
<Icon class=Signal::derive(cx, move || value() *2) path={HeroiconsOutlineChevronRight} />
<Icon class="w-5 h-5 mr-3" stroke="2" path={HeroiconsOutlineEllipsisVertical} />
</>
}
Each icon collection must be included with the corresponding feature flag, such as lucide
or font_awesome_solid
.
To save binary size, individual icons can also be included by feature flag, such as LucideZoomIn
or FontAwesomeSolidAtom
.
By default, no collections or icons are included. Be warned that including too many icons may result in a .wasm
binary
that some WebAssembly engines refuse to load, especially in debug mode (see rustwasm/wasm-pack#981).
Code is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Icons are licensed by their respective creators (see above). An license summary is emitted to the DOM for each icon:
<svg data-license="...original license...">