soma-ui 0.1.1

A Leptos 0.8 component library: 160+ accessible UI components, blocks, charts, and a ChartDB-style schema diagram — with a prebuilt stylesheet.
Documentation
use crate::components::shared::{disabled_cls, CONTROL_MOTION, FOCUS_RING};
use leptos::prelude::*;

#[component]
pub fn Slider(
    value: RwSignal<f64>,
    #[prop(default = 0.0)] min: f64,
    #[prop(default = 100.0)] max: f64,
    #[prop(default = 1.0)] step: f64,
    #[prop(default = false)] disabled: bool,
    #[prop(default = String::new())] class: String,
) -> impl IntoView {
    let disabled_class = if disabled {
        disabled_cls(true)
    } else {
        "cursor-pointer"
    };
    let combined = format!(
        "w-full h-2 rounded-full bg-input accent-primary shadow-elev-sm {} {} {} {}",
        CONTROL_MOTION, FOCUS_RING, disabled_class, class
    );
    view! {
        <input
            type="range"
            min=min
            max=max
            step=step
            disabled=disabled
            class=combined
            prop:value=move || value.get().to_string()
            on:input=move |e| {
                if let Ok(v) = event_target_value(&e).parse::<f64>() {
                    value.set(v);
                }
            }
        />
    }
}