8 releases (4 breaking)

new 0.5.0 May 14, 2024
0.4.0 May 14, 2024
0.3.1 Feb 23, 2024
0.2.1 Jan 3, 2024
0.1.0 Oct 19, 2023

#165 in Images

Download history 7/week @ 2024-01-25 2/week @ 2024-02-01 47/week @ 2024-02-15 228/week @ 2024-02-22 50/week @ 2024-02-29 37/week @ 2024-03-07 19/week @ 2024-03-14 10/week @ 2024-03-21 26/week @ 2024-03-28 20/week @ 2024-04-04 11/week @ 2024-04-11 9/week @ 2024-04-18 7/week @ 2024-04-25 107/week @ 2024-05-09

124 downloads per month

MIT license

6.5MB
87K SLoC

phosphor-leptos

Phosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really. More icons at phosphoricons.com.

Installation

phosphor-leptos = "0.5.0"

or

cargo add phosphor-leptos

Usage

use leptos::*;
use phosphor_leptos::{IconWeight, Horse, Heart, Cube};
#[component]
fn MyComponent() -> impl IntoView {
    view! {
        <Horse />
        <Heart color="#AE2983" weight=IconWeight::Fill size="32px" />
        <Cube color="teal" weight=IconWeight::Duotone />
    }
}

Props

All of the props are MaybeSignal's 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

~20–32MB
~522K SLoC