Repository navigation
Changes in this version:
[0.20.0] - 2026-10-19
Breaking Changes 🛠
-
Leptos-Use has been split into micro crates. Every function now lives in its own crate named after it, for example
use_mouseis now inleptos-use-mouse(leptos_use_mouse::use_mouse). Related functions share a crate
(leptos-use-storage,leptos-use-math,leptos-use-is,leptos-use-preferences, …) and the former
core/utilsmodules becameleptos-use-core,leptos-use-element,leptos-use-maybe-rw-signal,
leptos-use-filters, … The Leptos-independent helpers are now the standalone crateswasm-js-macros(js!,
js_fut!) andsendwrap-fn(sendwrap_fn!).
Every crate has its ownssrfeature (andaxum/actixwhere it reads request headers). -
The
leptos-usecrate still compiles with the same features and paths but only contains deprecated forwarding
wrappers that tell you which micro crate to add instead. -
use_calendaris now generic over the date type via the new traitCalendarDateType.
UseCalendarOptions,UseCalendarReturnandCalendarDategot a date type parameter and
use_calendar()needs a type annotation, e.g.use_calendar::<chrono::NaiveDate>(). -
The feature
use_calendarno longer enableschrono. Enable one of the new featureschrono,jiffortime
(chronois part of the default features). -
CalendarDatecomparison methods (is_selected,is_before, …) compare by calendar day. -
WatchOptionsandUseStorageOptionsgot a filter type parameter which defaults to the newNoFilter.
debounce/throttle/filterchange it toFilterOptions. This way the debounce and throttle code is only
compiled into your app when you use it. Code that names these types with a filter has to write
WatchOptions<FilterOptions>/UseStorageOptions<T, E, D, FilterOptions>. -
The default
targetofUseColorModeOptionsis the document's root element instead of the selector"html",
which saves the code that looks up elements by selector.UseColorModeOptions::default()is now of the type
UseColorModeOptions<Option<web_sys::Element>, _>.
New Features 🚀
use_calendarsupportsjiff(jiff::civil::Date,jiff::Zoned) andtime(time::Date,time::OffsetDateTime)
behind the featuresjiffandtime.use_calendarsupportschrono::DateTime<Utc>,chrono::DateTime<Local>andchrono::DateTime<FixedOffset>.- Every micro crate has browser tests (
wasm-bindgen-testin headless Chrome), run in CI. - The book shows how much each function adds to the gzipped wasm binary of an app.
Changes ✨
use_color_mode: withcookie_enabled, storeAutoasauto-dark/auto-lightso SSR renders the right mode without theSec-CH-Prefers-Color-Schemeheaderuse_color_mode: new optioncookie_max_age(defaults to one year) so the cookie outlives the browser sessionuse_color_mode: withcookie_enabled, the cookie is the only storage andstorage_enabledis ignored
Fixes 🍕
use_device_orientationnever listened fordeviceorientationevents, so it never reported any valuesuse_clipboardwithread(true)never listened forcopy/cuteventsuse_web_notificationnever closed the notification when the page became visible againuse_infinite_scrollstopped loading after a load that grew the content without filling the elementuse_idlelistens for activity onwindowinstead ofdocument, so the defaultresizeevent counts as activity