lucide/packages/leptos/src/bug.rs
rust-for-web[bot] 86b7fe3d9e
feat: update to upstream v0.543.0 (#158)
Co-authored-by: rust-for-web[bot] <191031261+rust-for-web[bot]@users.noreply.github.com>
2025-09-10 08:51:30 +02:00

45 lines
1.6 KiB
Rust

use leptos::{prelude::*, svg::Svg};
#[component]
pub fn Bug(
#[prop(default = 24.into(), into)] size: Signal<usize>,
#[prop(default = "currentColor".into(), into)] color: Signal<String>,
#[prop(default = "none".into(), into)] fill: Signal<String>,
#[prop(default = 2.into(), into)] stroke_width: Signal<usize>,
#[prop(default = false.into(), into)] absolute_stroke_width: Signal<bool>,
#[prop(optional)] node_ref: NodeRef<Svg>,
) -> impl IntoView {
let stroke_width = Signal::derive(move || {
if absolute_stroke_width.get() {
stroke_width.get() * 24 / size.get()
} else {
stroke_width.get()
}
});
view! {
<svg
node_ref=node_ref
class:lucide=true
xmlns="http://www.w3.org/2000/svg"
width=size
height=size
viewBox="0 0 24 24"
fill=fill
stroke=color
stroke-width=stroke_width
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 20v-9" />
<path d="M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" />
<path d="M14.12 3.88 16 2" />
<path d="M21 21a4 4 0 0 0-3.81-4" />
<path d="M21 5a4 4 0 0 1-3.55 3.97" />
<path d="M22 13h-4" />
<path d="M3 21a4 4 0 0 1 3.81-4" />
<path d="M3 5a4 4 0 0 0 3.55 3.97" />
<path d="M6 13H2" />
<path d="m8 2 1.88 1.88" />
<path d="M9 7.13V6a3 3 0 1 1 6 0v1.13" />
</svg>
}
}