11 releases (6 breaking)

0.7.0 Dec 17, 2024
0.6.0 Sep 20, 2024
0.5.1 Jun 16, 2024
0.3.1 Feb 23, 2024
0.1.0 Oct 19, 2023

#100 in Images

Download history 20/week @ 2024-11-20 52/week @ 2024-11-27 82/week @ 2024-12-04 183/week @ 2024-12-11 184/week @ 2024-12-18 68/week @ 2024-12-25 99/week @ 2025-01-01 246/week @ 2025-01-08 87/week @ 2025-01-15 23/week @ 2025-01-22 144/week @ 2025-01-29 131/week @ 2025-02-05 90/week @ 2025-02-12 133/week @ 2025-02-19 148/week @ 2025-02-26 78/week @ 2025-03-05

479 downloads per month
Used in anaso_components_stela

MIT license

4.5MB
12K SLoC

phosphor-leptos

crates.io docs.rs

Phosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really. You can explore the available icons at phosphoricons.com.

Installation

phosphor-leptos = "0.6.0"

or

cargo add phosphor-leptos

Usage

use leptos::prelude::*;
use phosphor_leptos::{Icon, IconWeight, HORSE, HEART, CUBE};

#[component]
fn MyComponent() -> impl IntoView {
    view! {
        <Icon icon=HORSE />
        <Icon icon=HEART color="#AE2983" weight=IconWeight::Fill size="32px" />
        <Icon icon=CUBE color="teal" weight=IconWeight::Duotone />
    }
}

Props

All of the props are Signals so they can be static or reactive.

  • color?: string – Icon stroke/fill color. Can be any CSS color string, including hex, rgb, rgba, hsl, hsla, named colors, or the special currentColor variable.
  • size?: number | string – Icon height & width. As with standard React elements, this can be a number, or a string with units in px, %, em, rem, pt, cm, mm, in.
  • weight?: IconWeight – Icon weight/style. Can also be used, for example, to "toggle" an icon's state: a rating component could use Stars with IconWeight::Regular to denote an empty star, and IconWeight::Fill to denote a filled star.
  • mirrored?: boolean – Flip the icon horizontally. Can be useful in RTL languages where normal icon orientation is not appropriate.

License

MIT © Phosphor Icons

Knowledge

Contributing

To generate all the icons, run

cargo xtask update

Dependencies

~21–34MB
~523K SLoC