Icons for leptos
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-12-19 00:11:45 +00:00
.github/workflows Add commit onto workflow 2024-01-07 15:15:14 +00:00
.vscode Add icons 2024-01-07 14:45:33 +00:00
fontawesome@af620534bf auto-update icons / pull submodules 2024-12-19 00:11:45 +00:00
heroicons@2d1c52ce68 auto-update icons / pull submodules 2024-12-19 00:11:45 +00:00
lucide@94782f53c1 auto-update icons / pull submodules 2024-12-19 00:11:45 +00:00
src auto-update icons / pull submodules 2024-12-19 00:11:45 +00:00
.gitignore initial 2023-02-06 21:03:14 -03:00
.gitmodules add fontawesome submodule 2024-02-22 19:22:51 +00:00
Cargo.toml auto-update icons / pull submodules 2024-12-19 00:11:45 +00:00
README.md update readme.md 2024-02-22 19:24:30 +00:00

leptos-icons

This crate makes it easy to use SVG icons from the following collections (more may be added in the future):

Usage

[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(move || value() *2) path={HeroiconsOutlineChevronRight} />
        <Icon class="w-5 h-5 mr-3" stroke="2" path={HeroiconsOutlineEllipsisVertical} />
    </>
}

Feature Flags

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 https://github.com/rustwasm/wasm-pack/issues/981).

License

Code is licensed under either of

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...">