Expand description
Collection of essential Leptos utilities inspired by SolidJS USE / VueUse
Re-exports§
pub use core::ReconnectLimit;
pub use crate::utils::DebounceOptions;
pub use crate::utils::ThrottleOptions;
Modules§
- core
- docs
- Collection of documentation related utilities. Used extensively in the examples.
- math
- Collection of reactive math functions
- storage
- utils
Macros§
- filter_
builder_ methods - Defines builder methods to define filter options without having to use nested methods
- js
- js_fut
- sendwrap_
fn - Macro to wrap closures with
send_wrapper::SendWrapper
. - use_
derive_ signal - Macro to easily create helper functions that derive a signal using a piece of code.
Structs§
- Audio
Track Constraints - Dummy
Encoder - Heartbeat
Options - Options for heartbeats
- OnClick
Outside Options - Options for
on_click_outside_with_options
. - Scroll
Offset - Threshold in pixels when we consider a side to have arrived (
UseScrollReturn::arrived_state
). - Scroll
State - The scroll state being passed into the
on_load_more
callback ofuse_infinite_scroll
. - Show
Options - Options for
UseWebNotificationReturn::show
. - Sync
Signal Options - Options for
sync_signal_with_options
. - UseBreakpoints
Return - Return type of
use_breakpoints
- UseBroadcast
Channel Return - Return type of
use_broadcast_channel
. - UseCalendar
Options - Options for
use_calendar_with_options
. - UseCalendar
Return - Return type of
use_calendar
. - UseClipboard
Options - Options for
use_clipboard_with_options
. - UseClipboard
Return - Return type of
use_clipboard
. - UseColor
Mode Options - UseColor
Mode Return - Return type of
use_color_mode
- UseCookie
Options - Options for
use_cookie_with_options
. - UseCss
VarOptions - Options for
use_css_var_with_options
. - UseCycle
List Options - Options for
use_cycle_list_with_options
. - UseCycle
List Return - Return type of
use_cycle_list
. - UseDevice
Orientation Return - Return type of
use_device_orientation
. - UseDisplay
Media Options - Options for
use_display_media
. - UseDisplay
Media Return - Return type of
use_display_media
- UseDocument
- Return type of
use_document
. - UseDraggable
Callback Args - Argument for the
on_...
handler functions ofUseDraggableOptions
. - UseDraggable
Options - Options for
use_draggable_with_options
. - UseDraggable
Return - Return type of
use_draggable
. - UseDrop
Zone Event - Event passed as argument to the event handler functions of
UseDropZoneOptions
. - UseDrop
Zone Options - Options for
use_drop_zone_with_options
. - UseDrop
Zone Return - Return type of
use_drop_zone
. - UseElement
Bounding Options - Options for
use_element_bounding_with_options
. - UseElement
Bounding Return - Return type of
use_element_bounding
. - UseElement
Hover Options - Options for
use_element_hover_with_options
. - UseElement
Size Options - Options for
use_element_size_with_options
. - UseElement
Size Return - The return value of
use_element_size
. - UseElement
Visibility Options - Options for
use_element_visibility_with_options
. - UseEvent
Listener Options - Options for
use_event_listener_with_options
. - UseEvent
Source Options - Options for
use_event_source_with_options
. - UseEvent
Source Return - Return type of
use_event_source
. - UseFavicon
Options - Options for
use_favicon_with_options
. - UseGeolocation
Options - Options for
use_geolocation_with_options
. - UseGeolocation
Return - Return type of
use_geolocation
. - UseIdle
Options - Options for
use_idle_with_options
. - UseIdle
Return - Return type of
use_idle
. - UseInfinite
Scroll Options - Options for
use_infinite_scroll_with_options
. - UseIntersection
Observer Options - Options for
use_intersection_observer_with_options
. - UseIntersection
Observer Return - The return value of
use_intersection_observer
. - UseInterval
FnOptions - Options for
use_interval_fn_with_options
- UseInterval
Options - Options for
use_interval_with_options
- UseInterval
Return - Return type of
use_interval
. - UseIntl
Number Format Options - Options for
use_intl_number_format
. - UseIntl
Number Format Return - Return type of
use_intl_number_format
. - UseLocales
Options - Options for
crate::use_locales_with_options
. - UseMouse
InElement Options - Options for
use_mouse_in_element_with_options
. - UseMouse
InElement Return - Return type of
use_mouse_in_element
. - UseMouse
Options - Options for
use_mouse_with_options
. - UseMouse
Return - Return type of
use_mouse
. - UseMutation
Observer Options - Options for
use_mutation_observer_with_options
. - UseMutation
Observer Return - The return value of
use_mutation_observer
. - UsePreferred
Dark Options - Options for
crate::use_preferred_dark_with_options
. - UsePrefers
Reduced Motion Options - Options for
crate::use_prefers_reduced_motion_with_options
. - UseRaf
FnCallback Args - Type of the argument for the callback of
use_raf_fn
. - UseRaf
FnOptions - Options for
use_raf_fn_with_options
. - UseResize
Observer Options - Options for
use_resize_observer_with_options
. - UseResize
Observer Return - The return value of
use_resize_observer
. - UseScroll
Options - Options for
use_scroll
. Options foruse_scroll_with_options
. - UseScroll
Return - The return value of
use_scroll
. - UseService
Worker Options - Options for
use_service_worker_with_options
. - UseService
Worker Return - Return type of
use_service_worker
. - UseTextarea
Autosize Options - Options for
crate::use_textarea_autosize_with_options
. - UseTextarea
Autosize Return - Return type of
crate::use_textarea_autosize
. - UseTimeout
FnReturn - Return type of
use_timeout_fn
. - UseTimestamp
Options - Options for
use_timestamp_with_controls_and_options
. - UseTimestamp
Return - Return type of
use_timestamp_with_controls
. - UseToggle
Return - Return type of
crate::use_toggle
. - UseUser
Media Options - Options for
use_user_media_with_options
. - UseUser
Media Return - Return type of
use_user_media
. - UseWeb
Lock Options - Options for
crate::use_web_lock_with_options
. - UseWeb
Notification Options - Options for
use_web_notification_with_options
. See MDN Docs for more info. - UseWeb
Notification Return - Return type for
use_web_notification
. - UseWeb
Socket Options - Options for
use_websocket_with_options
. - UseWeb
Socket Return - Return type of
use_websocket
. - UseWindow
- Return type of
use_window
. - UseWindow
Size Options - Options for
crate::use_window_size_with_options
. - UseWindow
Size Return - Return type of
crate::use_window_size
. - VecMarker
- Video
Track Constraints - Watch
Debounced Options - Options for
watch_debounced_with_options
. - Watch
Options - Options for
watch_with_options
- Watch
Pausable Return - Return type of
watch_pausable
- Watch
Throttled Options - Options for
watch_throttled_with_options
.
Enums§
- Audio
Constraints - Breakpoints
AntDesign - Breakpoint keys for Ant Design
- Breakpoints
Bootstrap V5 - Breakpoint keys for Bootstrap V5
- Breakpoints
Master Css - Breakpoint keys for Master CSS
- Breakpoints
Material - Breakpoint keys for Material UI V5
- Breakpoints
Quasar - Breakpoint keys for Quasar V2
- Breakpoints
Semantic - Breakpoint keys for Semantic UI
- Breakpoints
Tailwind - Breakpoint keys for Tailwind V2
- Calendar
Date - Utility enum to represent a calendar date. Implements
Deref
tochrono::NaiveDate
. - Color
Mode - Color modes
- Compact
Display - Constraint
Exact Ideal - Constraint
Range - Currency
Display - How to display the currency in currency formatting.
- Currency
Sign - Facing
Mode - Locale
Matcher - Lock
Mode - The
LockMode
enum. - Measure
Type - Type of the
measure_type
option. - Notation
- The formatting that should be displayed for the number.
- Notification
Direction - Notification
Permission - The permission to send notifications
- Number
Grouping - Number
Style - Permission
State - Return type of
use_permission
. - Preferred
Contrast - Return value for
use_preferred_contrast
- Rounding
Mode - Rounding
Priority - Same
Site - The
SameSite
cookie attribute. - Scroll
Behavior - The scroll behavior.
Can be
Auto
(= not smooth) orSmooth
. Defaults toAuto
. - Service
Worker Registration Error - Sign
Display - When to display the sign for the number.
- Sync
Direction - Direction of syncing.
- Sync
Transforms - Transforms or assigns for syncing.
- Timestamp
Interval - Interval type for
UseTimestampOptions
. - Trailing
Zero Display - Unit
Display - UseBroadcast
Channel Error - UseEvent
Source Error - UseMouse
Coord Type - Defines how to get the coordinates from the event.
- UseMouse
Source Type - Identifies the source of the reported coordinates
- UseWeb
Lock Error - UseWeb
Socket Error - Video
Constraints
Traits§
- Into
Device Ids - UseMouse
Event Extractor - Trait to implement if you want to specify a custom extractor
Functions§
- breakpoints_
ant_ design - Breakpoint definitions for Ant Design
- breakpoints_
bootstrap_ v5 - Breakpoint definitions for Bootstrap V5
- breakpoints_
master_ css - Breakpoint definitions for Master CSS
- breakpoints_
material - Breakpoint definitions for Material UI V5
- breakpoints_
quasar - Breakpoint definitions for Quasar V2
- breakpoints_
semantic - Breakpoint definitions for Semantic UI
- breakpoints_
tailwind - Breakpoint definitions for Tailwind V2
- is_err
- Reactive
Result::is_err()
. - is_none
- Reactive
Option::is_none()
. - is_ok
- Reactive
Result::is_ok()
. - is_some
- Reactive
Option::is_some()
. - on_
click_ outside - Listen for clicks outside an element. Useful for modals or dropdowns.
- on_
click_ outside_ with_ options - Version of
on_click_outside
that takes anOnClickOutsideOptions
. Seeon_click_outside
for more details. - signal_
debounced - Debounce changing of a
Signal
value. - signal_
debounced_ local - Debounce changing of a
Signal
value that is notSend + Sync
. - signal_
debounced_ local_ with_ options - Version of
signal_debounced_local
that acceptsDebounceOptions
. Seesignal_debounced_local
for how to use. - signal_
debounced_ with_ options - Version of
signal_debounced
that acceptsDebounceOptions
. Seesignal_debounced
for how to use. - signal_
throttled - Throttle changing of a
Signal
value. - signal_
throttled_ local - Throttle changing of a
Signal
value that is notSend + Sync
. - signal_
throttled_ local_ with_ options - Version of
signal_throttled_local
that accepts [ThrottledOptions
] . Seesignal_throttled_local
for how to use. - signal_
throttled_ with_ options - Version of
signal_throttled
that acceptsThrottleOptions
. Seesignal_throttled
for how to use. - sync_
signal - Two-way Signals synchronization.
- sync_
signal_ with_ options - Version of
sync_signal
that takes aSyncSignalOptions
. Seesync_signal
for how to use. - use_
active_ element - Reactive
document.activeElement
- use_
breakpoints - Reactive viewport breakpoints.
- use_
broadcast_ channel - Reactive BroadcastChannel API.
- use_
calendar - Create bare-bone calendar data to use in your component.
See
UseCalendarOptions
for options andUseCalendarReturn
for return values. - use_
calendar_ with_ options - Version of
use_calendar
that takes aUseCalendarOptions
. Seeuse_calendar
for how to use. - use_
clipboard - Reactive Clipboard API.
- use_
clipboard_ with_ options - Version of
use_clipboard
that takes aUseClipboardOptions
. Seeuse_clipboard
for how to use. - use_
color_ mode - Reactive color mode (dark / light / customs) with auto data persistence.
- use_
color_ mode_ with_ options - Version of
use_color_mode
that takes aUseColorModeOptions
. Seeuse_color_mode
for how to use. - use_
cookie - SSR-friendly and reactive cookie access.
- use_
cookie_ with_ options - Version of
use_cookie
that takesUseCookieOptions
. - use_
css_ var - Manipulate CSS variables.
- use_
css_ var_ with_ options - Version of
use_css_var
that takes aUseCssVarOptions
. Seeuse_css_var
for how to use. - use_
cycle_ list - Cycle through a list of items.
- use_
cycle_ list_ with_ options - use_
debounce_ fn - Debounce execution of a function.
- use_
debounce_ fn_ with_ arg - Version of
use_debounce_fn
with an argument for the debounced function. See the docs foruse_debounce_fn
for how to use. - use_
debounce_ fn_ with_ arg_ and_ options - Version of
use_debounce_fn_with_arg
with debounce options. - use_
debounce_ fn_ with_ options - Version of
use_debounce_fn
with debounce options. See the docs foruse_debounce_fn
for how to use. - use_
device_ orientation - Reactive DeviceOrientationEvent.
- use_
device_ pixel_ ratio - Reactive
window.devicePixelRatio
- use_
display_ media - Reactive
mediaDevices.getDisplayMedia
streaming. - use_
display_ media_ with_ options - Version of
use_display_media
that accepts aUseDisplayMediaOptions
. - use_
document - SSR safe
document()
. This returns just a new-type wrapper aroundOption<Document>
. Calling this amounts toNone
on the server andSome(Document)
on the client. - use_
document_ visibility - Reactively track
document.visibilityState
- use_
draggable - Make elements draggable.
- use_
draggable_ with_ options - Version of
use_draggable
that takes aUseDraggableOptions
. Seeuse_draggable
for how to use. - use_
drop_ zone - Create a zone where files can be dropped.
- use_
drop_ zone_ with_ options - Version of
use_drop_zone
that takes aUseDropZoneOptions
. Seeuse_drop_zone
for how to use. - use_
element_ bounding - Reactive bounding box of an HTML element
- use_
element_ bounding_ with_ options - Version of
use_element_bounding
that takes aUseElementBoundingOptions
. Seeuse_element_bounding
for how to use. - use_
element_ hover - Reactive element’s hover state.
- use_
element_ hover_ with_ options - Version of
use_element_hover
that takes aUseElementHoverOptions
. Seeuse_element_hover
for how to use. - use_
element_ size - Reactive size of an HTML element.
- use_
element_ size_ with_ options - Version of
use_element_size
that takes aUseElementSizeOptions
. Seeuse_element_size
for how to use. - use_
element_ visibility - Tracks the visibility of an element within the viewport.
- use_
element_ visibility_ with_ options - Version of
use_element_visibility
with that takes aUseElementVisibilityOptions
. Seeuse_element_visibility
for how to use. - use_
event_ listener - Use EventListener with ease.
- use_
event_ listener_ with_ options - Version of
use_event_listener
that takesweb_sys::AddEventListenerOptions
. See the docs foruse_event_listener
for how to use. - use_
event_ source - Reactive EventSource
- use_
event_ source_ with_ options - Version of
use_event_source
that takes aUseEventSourceOptions
. Seeuse_event_source
for how to use. - use_
favicon - Reactive favicon.
- use_
favicon_ with_ options - Version of
use_favicon
that accepts aUseFaviconOptions
. Seeuse_favicon
for more details. - use_
geolocation - Reactive Geolocation API.
- use_
geolocation_ with_ options - Version of
use_geolocation
that takes aUseGeolocationOptions
. Seeuse_geolocation
for how to use. - use_
idle - Tracks whether the user is being inactive.
- use_
idle_ with_ options - Version of
use_idle
that takes aUseIdleOptions
. Seeuse_idle
for how to use. - use_
infinite_ scroll - Infinite scrolling of the element.
- use_
infinite_ scroll_ with_ options - Version of
use_infinite_scroll
that takes aUseInfiniteScrollOptions
. Seeuse_infinite_scroll
for how to use. - use_
intersection_ observer - Reactive IntersectionObserver.
- use_
intersection_ observer_ with_ options - Version of
use_intersection_observer
that takes aUseIntersectionObserverOptions
. Seeuse_intersection_observer
for how to use. - use_
interval - Reactive counter increases on every interval.
- use_
interval_ fn - Wrapper for
set_interval
with controls. - use_
interval_ fn_ with_ options - Version of
use_interval_fn
that takesUseIntervalFnOptions
. Seeuse_interval_fn
for how to use. - use_
interval_ with_ options - Version of
use_interval
that takesUseIntervalOptions
. Seeuse_interval
for how to use. - use_
intl_ number_ format - Reactive
Intl.NumberFormat
. - use_
locale - Reactive locale matching.
- use_
locale_ with_ options - Version of
crate::use_locale
that takes aUseLocaleOptions
. Seecrate::use_locale
for how to use. - use_
locales - Reactive locales.
- use_
locales_ with_ options - Version of
crate::use_locales
that takes aUseLocalesOptions
. Seecrate::use_locales
for how to use. - use_
media_ query - Reactive Media Query.
- use_
mouse - Reactive mouse position
- use_
mouse_ in_ element - Reactive mouse position related to an element.
- use_
mouse_ in_ element_ with_ options - Version of
use_mouse_in_element
that takes aUseMouseInElementOptions
. Seeuse_mouse_in_element
for how to use. - use_
mouse_ with_ options - Variant of
use_mouse
that accepts options. Please seeuse_mouse
for how to use. - use_
mutation_ observer - Reactive MutationObserver.
- use_
mutation_ observer_ with_ options - Version of
use_mutation_observer
that takes aUseMutationObserverOptions
. Seeuse_mutation_observer
for how to use. - use_
permission - Reactive Permissions API.
- use_
preferred_ contrast - Reactive prefers-contrast media query.
- use_
preferred_ dark - Reactive dark theme preference.
- use_
preferred_ dark_ with_ options - Version of
crate::use_preferred_dark
that accepts aUsePreferredDarkOptions
. - use_
prefers_ reduced_ motion - Reactive reduced motions preference.
- use_
prefers_ reduced_ motion_ with_ options - Version of
crate::use_prefers_reduced_motion
that takes aUsePrefersReducedMotionOptions
. Seecrate::use_prefers_reduced_motion
for how to use. - use_
raf_ fn - Call function on every requestAnimationFrame. With controls of pausing and resuming.
- use_
raf_ fn_ with_ options - Version of
use_raf_fn
that takes aUseRafFnOptions
. Seeuse_raf_fn
for how to use. - use_
resize_ observer - Reports changes to the dimensions of an Element’s content or the border-box.
- use_
resize_ observer_ with_ options - Version of
use_resize_observer
that takes aweb_sys::ResizeObserverOptions
. Seeuse_resize_observer
for how to use. - use_
scroll - Reactive scroll position and state.
- use_
scroll_ with_ options - Version of
use_scroll
with options. Seeuse_scroll
for how to use. - use_
service_ worker - Reactive ServiceWorker API.
- use_
service_ worker_ with_ options - Version of
use_service_worker
that takes aUseServiceWorkerOptions
. Seeuse_service_worker
for how to use. - use_
sorted - Reactive sort of iterable
- use_
sorted_ by - Version of
use_sorted
with a compare function. - use_
sorted_ by_ key - Version of
use_sorted
by key. - use_
supported - SSR compatibe
is_supported
- use_
textarea_ autosize - Automatically update the height of a textarea depending on the content.
- use_
textarea_ autosize_ with_ options - Version of
crate::use_textarea_autosize
that takes aUseTextareaAutosizeOptions
. Seecrate::use_textarea_autosize
for how to use. - use_
throttle_ fn - Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.
- use_
throttle_ fn_ with_ arg - Version of
use_throttle_fn
with an argument for the throttled function. See the docs foruse_throttle_fn
for how to use. - use_
throttle_ fn_ with_ arg_ and_ options - Version of
use_throttle_fn_with_arg
with throttle options. See the docs foruse_throttle_fn
for how to use. - use_
throttle_ fn_ with_ options - Version of
use_throttle_fn
with throttle options. See the docs foruse_throttle_fn
for how to use. - use_
timeout_ fn - Wrapper for
setTimeout
with controls. - use_
timestamp - Reactive current timestamp.
- use_
timestamp_ with_ controls - Version of
use_timestamp
that returns controls. Seeuse_timestamp
for how to use. - use_
timestamp_ with_ controls_ and_ options - Version of
use_timestamp
that takes aUseTimestampOptions
and returns controls. Seeuse_timestamp
for how to use. - use_
timestamp_ with_ options - Version of
use_timestamp
that takes aUseTimestampOptions
. Seeuse_timestamp
for how to use. - use_
to_ string - Reactive
ToString::to_string()
. - use_
toggle - A boolean switcher with utility functions.
- use_
user_ media - Reactive
mediaDevices.getUserMedia
streaming. - use_
user_ media_ with_ options - Version of
use_user_media
that takes aUseUserMediaOptions
. Seeuse_user_media
for how to use. - use_
web_ lock - Rustified Web Locks API.
- use_
web_ lock_ with_ options - Version of
crate::use_web_lock
that takes aUseWebLockOptions
. Seecrate::use_web_lock
for how to use. - use_
web_ notification - Reactive Notification API.
- use_
web_ notification_ with_ options - Version of
use_web_notification
which takes anUseWebNotificationOptions
. - use_
websocket - Creating and managing a Websocket connection.
- use_
websocket_ with_ options - Version of
use_websocket
that takesUseWebSocketOptions
. Seeuse_websocket
for how to use. - use_
window - SSR safe
window()
. This returns just a new-type wrapper aroundOption<Window>
. Calling this amounts toNone
on the server andSome(Window)
on the client. - use_
window_ focus - Reactively track window focus
with
window.onfocus
andwindow.onblur
events. - use_
window_ scroll - Reactive window scroll.
- use_
window_ size - Reactive window size.
- use_
window_ size_ with_ options - Version of
crate::use_window_size
that takes aUseWindowSizeOptions
. Seecrate::use_window_size
for how to use. - watch_
debounced - A debounced version of
watch
. - watch_
debounced_ with_ options - Version of
watch_debounced
that acceptsWatchDebouncedOptions
. Seewatch_debounced
for how to use. - watch_
pausable - Pausable
watch
. - watch_
pausable_ with_ options - Version of
watch_pausable
that acceptsWatchOptions
. Seewatch_pausable
for how to use. - watch_
throttled - A throttled version of
leptos::watch
. - watch_
throttled_ with_ options - Version of
watch_throttled
that acceptsWatchThrottledOptions
. Seewatch_throttled
for how to use. - watch_
with_ options - A version of
leptos::watch
but with additional options. - whenever
- Shorthand for watching a signal to be
true
. - whenever_
with_ options - Version of
whenever
that acceptsWatchOptions
. Seewhenever
for how to use.