Get Started
Installation
Every function lives in its own small crate. Add the ones you need, for example:
cargo add leptos-use-mouse
Each function’s page in this book tells you which crate to add.
The all-in-one
leptos-usecrate still exists but only re-exports the micro crates with deprecation notes. It will not receive new functionality.
Examples
Usage Example
Simply import the functions you need from their crates
use leptos::prelude::*;
use leptos_use_mouse::{use_mouse, UseMouseReturn};
#[component]
fn Demo() -> impl IntoView {
let UseMouseReturn { x, y, .. } = use_mouse();
view! { cx,
{x} " x " {y}
}
}
Please refer to the functions list for more details.
Stable Rust
Just like leptos this library can be safely run on stable rust.
In the Getting Started section
of the leptos docs you can read more about what this means.