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§
- Collection of documentation related utilities. Used extensively in the examples.
- Collection of reactive math functions
Macros§
- Defines builder methods to define filter options without having to use nested methods
- Macro to easily create helper functions that derive a signal using a piece of code.
Structs§
- Options for
on_click_outside_with_options
. - Threshold in pixels when we consider a side to have arrived (
UseScrollReturn::arrived_state
). - The scroll state being passed into the
on_load_more
callback ofuse_infinite_scroll
. - Options for
UseWebNotificationReturn::show
. - Options for
sync_signal_with_options
. - Return type of
use_breakpoints
- Return type of
use_broadcast_channel
. - Options for
use_clipboard_with_options
. - Return type of
use_clipboard
. - Return type of
use_color_mode
- Options for
use_cookie_with_options
. - Options for
use_css_var_with_options
. - Options for
use_cycle_list_with_options
. - Return type of
use_cycle_list
. - Return type of
use_device_orientation
. - Options for
use_display_media
. - Return type of
use_display_media
- Return type of
use_document
. - Argument for the
on_...
handler functions ofUseDraggableOptions
. - Options for
use_draggable_with_options
. - Return type of
use_draggable
. - Event passed as argument to the event handler functions of
UseDropZoneOptions
. - Options for
use_drop_zone_with_options
. - Return type of
use_drop_zone
. - Options for
use_element_bounding_with_options
. - Return type of
use_element_bounding
. - Options for
use_element_hover_with_options
. - Options for
use_element_size_with_options
. - The return value of
use_element_size
. - Options for
use_element_visibility_with_options
. - Options for
use_event_listener_with_options
. - Options for
use_event_source_with_options
. - Return type of
use_event_source
. - Options for
use_favicon_with_options
. - Options for
use_geolocation_with_options
. - Return type of
use_geolocation
. - Options for
use_idle_with_options
. - Return type of
use_idle
. - Options for
use_infinite_scroll_with_options
. - Options for
use_intersection_observer_with_options
. - The return value of
use_intersection_observer
. - Options for
use_interval_fn_with_options
- Options for
use_interval_with_options
- Return type of
use_interval
. - Options for
use_intl_number_format
. - Return type of
use_intl_number_format
. - Options for
crate::use_locales_with_options
. - Options for
use_mouse_in_element_with_options
. - Return type of
use_mouse_in_element
. - Options for
use_mouse_with_options
. - Return type of
use_mouse
. - Options for
use_mutation_observer_with_options
. - The return value of
use_mutation_observer
. - Options for
crate::use_preferred_dark_with_options
. - Options for
crate::use_prefers_reduced_motion_with_options
. - Type of the argument for the callback of
use_raf_fn
. - Options for
use_raf_fn_with_options
. - Options for
use_resize_observer_with_options
. - The return value of
use_resize_observer
. - Options for
use_scroll
. Options foruse_scroll_with_options
. - The return value of
use_scroll
. - Options for
use_service_worker_with_options
. - Return type of
use_service_worker
. - Options for
crate::use_textarea_autosize_with_options
. - Return type of
crate::use_textarea_autosize
. - Return type of
use_timeout_fn
. - Options for
use_timestamp_with_controls_and_options
. - Return type of
use_timestamp_with_controls
. - Return type of
crate::use_toggle
. - Options for
use_user_media_with_options
. - Return type of
use_user_media
. - Options for
crate::use_web_lock_with_options
. - Options for
use_web_notification_with_options
. See MDN Docs for more info. - Return type for
use_web_notification
. - Options for
use_websocket_with_options
. - Return type of
use_websocket
. - Return type of
use_window
. - Options for
crate::use_window_size_with_options
. - Return type of
crate::use_window_size
. - Options for
watch_debounced_with_options
. - Options for
watch_with_options
- Return type of
watch_pausable
- Options for
watch_throttled_with_options
.
Enums§
- Breakpoint keys for Ant Design
- Breakpoint keys for Bootstrap V5
- Breakpoint keys for Master CSS
- Breakpoint keys for Material UI V5
- Breakpoint keys for Quasar V2
- Breakpoint keys for Semantic UI
- Breakpoint keys for Tailwind V2
- Color modes
- How to display the currency in currency formatting.
- The
LockMode
enum. - Type of the
measure_type
option. - The formatting that should be displayed for the number.
- The permission to send notifications
- Return type of
use_permission
. - Return value for
use_preferred_contrast
- The
SameSite
cookie attribute. - The scroll behavior. Can be
Auto
(= not smooth) orSmooth
. Defaults toAuto
. - When to display the sign for the number.
- Direction of syncing.
- Transforms or assigns for syncing.
- Interval type for
UseTimestampOptions
. - Defines how to get the coordinates from the event.
- Identifies the source of the reported coordinates
Traits§
- Trait to implement if you want to specify a custom extractor
Functions§
- Breakpoint definitions for Ant Design
- Breakpoint definitions for Bootstrap V5
- Breakpoint definitions for Master CSS
- Breakpoint definitions for Material UI V5
- Breakpoint definitions for Quasar V2
- Breakpoint definitions for Semantic UI
- Breakpoint definitions for Tailwind V2
- Reactive
Result::is_err()
. - Reactive
Option::is_none()
. - Reactive
Result::is_ok()
. - Reactive
Option::is_some()
. - Listen for clicks outside of an element. Useful for modals or dropdowns.
- Version of
on_click_outside
that takes anOnClickOutsideOptions
. Seeon_click_outside
for more details. - Debounce changing of a
Signal
value. - Throttle changing of a
Signal
value. - Two-way Signals synchronization.
- Reactive
document.activeElement
- Reactive viewport breakpoints.
- Reactive BroadcastChannel API.
- Reactive Clipboard API.
- Reactive color mode (dark / light / customs) with auto data persistence.
- SSR-friendly and reactive cookie access.
- Version of
use_cookie
that takesUseCookieOptions
. - Manipulate CSS variables.
- Cycle through a list of items.
- Debounce execution of a function.
- Version of
use_debounce_fn
with an argument for the debounced function. See the docs foruse_debounce_fn
for how to use. - Version of
use_debounce_fn_with_arg
with debounce options. - Version of
use_debounce_fn
with debounce options. See the docs foruse_debounce_fn
for how to use. - Reactive DeviceOrientationEvent.
- Reactive
window.devicePixelRatio
- Reactive
mediaDevices.getDisplayMedia
streaming. - Version of
use_display_media
that accepts aUseDisplayMediaOptions
. - SSR safe
document()
. This returns just a new-type wrapper aroundOption<Document>
. Calling this amounts toNone
on the server andSome(Document)
on the client. - Reactively track
document.visibilityState
- Make elements draggable.
- Create a zone where files can be dropped.
- Reactive bounding box of an HTML element
- Version of
use_element_bounding
that takes aUseElementBoundingOptions
. Seeuse_element_bounding
for how to use. - Reactive element’s hover state.
- Version of
use_element_hover
that takes aUseElementHoverOptions
. Seeuse_element_hover
for how to use. - Reactive size of an HTML element.
- Version of
use_element_size
that takes aUseElementSizeOptions
. Seeuse_element_size
for how to use. - Tracks the visibility of an element within the viewport.
- Version of
use_element_visibility
with that takes aUseElementVisibilityOptions
. Seeuse_element_visibility
for how to use. - Use EventListener with ease.
- Version of
use_event_listener
that takesweb_sys::AddEventListenerOptions
. See the docs foruse_event_listener
for how to use. - Reactive EventSource
- Version of
use_event_source
that takes aUseEventSourceOptions
. Seeuse_event_source
for how to use. - Reactive favicon.
- Reactive Geolocation API.
- Demo
- Infinite scrolling of the element.
- Version of
use_infinite_scroll
that takes aUseInfiniteScrollOptions
. Seeuse_infinite_scroll
for how to use. - Reactive IntersectionObserver.
- Version of
use_intersection_observer
that takes aUseIntersectionObserverOptions
. Seeuse_intersection_observer
for how to use. - Reactive counter increases on every interval.
- Wrapper for
set_interval
with controls. - Reactive
Intl.NumberFormat
. - Reactive locale matching.
- Reactive locales.
- Version of
crate::use_locales
that takes aUseLocalesOptions
. Seecrate::use_locales
for how to use. - Reactive Media Query.
- Reactive mouse position
- Reactive mouse position related to an element.
- Version of
use_mouse_in_element
that takes aUseMouseInElementOptions
. Seeuse_mouse_in_element
for how to use. - Reactive MutationObserver.
- Version of
use_mutation_observer
that takes aUseMutationObserverOptions
. Seeuse_mutation_observer
for how to use. - Reactive Permissions API.
- Reactive prefers-contrast media query.
- Reactive dark theme preference.
- Version of
crate::use_preferred_dark
that accepts aUsePreferredDarkOptions
. - Reactive reduced motions preference.
- Version of
crate::use_prefers_reduced_motion
that takes aUsePrefersReducedMotionOptions
. Seecrate::use_prefers_reduced_motion
for how to use. - Call function on every requestAnimationFrame. With controls of pausing and resuming.
- Reports changes to the dimensions of an Element’s content or the border-box.
- Version of
use_resize_observer
that takes aweb_sys::ResizeObserverOptions
. Seeuse_resize_observer
for how to use. - Reactive scroll position and state.
- Version of
use_scroll
with options. Seeuse_scroll
for how to use. - Reactive ServiceWorker API.
- Version of
use_service_worker
that takes aUseServiceWorkerOptions
. Seeuse_service_worker
for how to use. - Reactive sort of iterable
- Version of
use_sorted
with a compare function. - Version of
use_sorted
by key. - SSR compatibe
is_supported
- Automatically update the height of a textarea depending on the content.
- Version of
crate::use_textarea_autosize
that takes aUseTextareaAutosizeOptions
. Seecrate::use_textarea_autosize
for how to use. - Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.
- Version of
use_throttle_fn
with an argument for the throttled function. See the docs foruse_throttle_fn
for how to use. - Version of
use_throttle_fn_with_arg
with throttle options. See the docs foruse_throttle_fn
for how to use. - Version of
use_throttle_fn
with throttle options. See the docs foruse_throttle_fn
for how to use. - Wrapper for
setTimeout
with controls. - Reactive current timestamp.
- Version of
use_timestamp
that returns controls. Seeuse_timestamp
for how to use. - Version of
use_timestamp
that takes aUseTimestampOptions
and returns controls. Seeuse_timestamp
for how to use. - Reactive
ToString::to_string()
. - A boolean switcher with utility functions.
- Reactive
mediaDevices.getUserMedia
streaming. - Rustified Web Locks API.
- Version of
crate::use_web_lock
that takes aUseWebLockOptions
. Seecrate::use_web_lock
for how to use. - Reactive Notification API.
- Version of
use_web_notification
which takes anUseWebNotificationOptions
. - Creating and managing a Websocket connection.
- SSR safe
window()
. This returns just a new-type wrapper aroundOption<Window>
. Calling this amounts toNone
on the server andSome(Window)
on the client. - Reactively track window focus with
window.onfocus
andwindow.onblur
events. - Reactive window scroll.
- Reactive window size.
- Version of
crate::use_window_size
that takes aUseWindowSizeOptions
. Seecrate::use_window_size
for how to use. - watch
Deprecated - A debounced version of
watch
. - Pausable
watch
. - A throttled version of
leptos::watch
. - A version of
leptos::watch
but with additional options. - Shorthand for watching a signal to be
true
.