Crates.io | leptos_lucide |
lib.rs | leptos_lucide |
version | 0.1.1 |
source | src |
created_at | 2024-03-24 06:45:16.307291 |
updated_at | 2024-03-24 09:32:36.611162 |
description | Lucide icons in Leptos. |
homepage | |
repository | https://github.com/opensourcecheemsburgers/leptos_lucide |
max_upload_size | |
id | 1184151 |
size | 538,744 |
This library provides Leptos components for Lucide SVGs .
From the project directory, use the following command:
cargo add leptos_lucide
Alternatively, add the following line to your Cargo.toml
:
leptos_lucide = "0.1.0"
Create a LucideAttributes
struct in a parent component. Then, use provide_context()
to pass the attributes to any Lucide icon.
new_with_attributes()
use leptos::*;
use leptos_lucide::icons::*;
#[component]
pub fn SomeComponent() -> impl IntoView {
let attributes = LucideAttributes::new_with_attributes(
"animate-pulse",
"http://www.w3.org/2000/svg",
24,
24,
"0 0 24 24",
"#ffffff",
"rgba(0,0,0,0.69)",
1.625,
"round",
"round"
);
let attributes_ctx = LucideAttributesCtx(RwSignal::new(attributes));
provide_context(attributes_ctx);
view! {
<Wallet/>
<WalletCards/>
<WalletMinimal/>
}
}
new()
- Builder Patternuse leptos::*;
use leptos_lucide::icons::*;
#[component]
pub fn ExampleComponent() -> impl IntoView {
let attributes = LucideAttributes::new()
.set_height(24)
.set_width(96)
.set_stroke_width(1.625);
let attributes_ctx = LucideAttributesCtx(RwSignal::new(attributes));
provide_context(attributes_ctx);
view! {
<Wallet/>
<WalletCards/>
<WalletMinimal/>
}
}