#leptos #utilities

leptos-use

Collection of essential Leptos utilities inspired by React-Use / VueUse / SolidJS-USE

90 releases

0.16.3 Sep 30, 2025
0.16.2 Jun 19, 2025
0.16.0-beta2 May 19, 2025
0.16.0-beta Mar 20, 2025
0.6.0 Jul 17, 2023

#25 in GUI

Download history 4617/week @ 2025-08-19 4227/week @ 2025-08-26 4848/week @ 2025-09-02 4426/week @ 2025-09-09 5347/week @ 2025-09-16 4834/week @ 2025-09-23 4910/week @ 2025-09-30 4160/week @ 2025-10-07 4649/week @ 2025-10-14 5272/week @ 2025-10-21 5166/week @ 2025-10-28 6027/week @ 2025-11-04 5095/week @ 2025-11-11 5088/week @ 2025-11-18 5130/week @ 2025-11-25 5046/week @ 2025-12-02

21,308 downloads per month
Used in 39 crates (31 directly)

MIT/Apache

690KB
13K SLoC


Leptos-Use – Collection of essential Leptos utilities

Collection of essential Leptos utilities

Inspired by React-Use / VueUse

Crates.io SSR Docs & Demos 88 Functions




Usage

Crates.io Total Downloads Docs MIT/Apache 2.0 Build Status Discord

use leptos::prelude::*;
use leptos_use::{use_mouse, UseMouseReturn};

#[component]
fn Demo() -> impl IntoView {
    let UseMouseReturn { x, y, .. } = use_mouse();

    view! { cx,
        {x} " x " {y}
    }
}

Missing a function? Open a ticket or PR!

Development

To run all tests run

# Run tests (general)
cargo test --features math,docs,ssr

# Run tests (axum) use_cookie
cargo test --features math,docs,ssr,axum --doc use_cookie

# Run tests (axum) use_locale
cargo test --features math,docs,ssr,axum --doc use_locale

# Run tests (actix) use_cookie
cargo test --features math,docs,ssr,actix --doc use_cookie

# Run tests (actix) use_locale
cargo test --features math,docs,ssr,actix --doc use_locale

Book

First you need to install

cargo install mdbook mdbook-cmdrun trunk

To build the book go in your terminal into the docs/book folder and run

mdbook serve

This builds the html version of the book and runs a local dev server. To also add in the examples open another shell and run

python3 post_build.py

If you only want to add the example for one function you can run for example

python3 post_build.py use_storage

New Function Template

To scaffold a new function quickly you can run template/createfn.sh. It requires that ffizer and Python 3 is installed. This will create the function file in the src directory, scaffold an example directory and an entry in the book.

Leptos compatibility

Crate version Compatible Leptos version
<= 0.3 0.3
0.4, 0.5, 0.6 0.4
0.7, 0.8, 0.9 0.5
0.10 – 0.13 0.6
0.14, 0.15 0.7
0.16 0.8

Dependencies

~23–43MB
~661K SLoC