Crates.io | phosphor-leptos |
lib.rs | phosphor-leptos |
version | 0.6.0 |
source | src |
created_at | 2023-10-19 20:26:39.015698 |
updated_at | 2024-09-20 05:13:04.48164 |
description | phosphor icons for leptos |
homepage | |
repository | https://github.com/SorenHolstHansen/phosphor-leptos |
max_upload_size | |
id | 1008308 |
size | 4,504,393 |
Phosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really. You can explore the available icons at phosphoricons.com.
phosphor-leptos = "0.6.0"
or
cargo add phosphor-leptos
use leptos::*;
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 />
}
}
All of the props are MaybeSignal
s so they can be static or reactive.
string
– Icon stroke/fill color. Can be any CSS color string, including hex
, rgb
, rgba
, hsl
, hsla
, named colors, or the special currentColor
variable.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
.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.boolean
– Flip the icon horizontally. Can be useful in RTL languages where normal icon orientation is not appropriate.MIT © Phosphor Icons
To generate all the icons, run
cargo xtask update