Crate leptos_use
source ·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_morecallback 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. - 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
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
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 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
SameSitecookie 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_outsidethat takes anOnClickOutsideOptions. Seeon_click_outsidefor more details. - Debounce changing of a
Signalvalue. - Throttle changing of a
Signalvalue. - 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_cookiethat takesUseCookieOptions. - Manipulate CSS variables.
- Cycle through a list of items.
- Debounce execution of a function.
- Version of
use_debounce_fnwith an argument for the debounced function. See the docs foruse_debounce_fnfor how to use. - Version of
use_debounce_fn_with_argwith debounce options. - Version of
use_debounce_fnwith debounce options. See the docs foruse_debounce_fnfor how to use. - Reactive DeviceOrientationEvent.
- Reactive
window.devicePixelRatio - Reactive
mediaDevices.getDisplayMediastreaming. - Version of
use_display_mediathat accepts aUseDisplayMediaOptions. - SSR safe
document(). This returns just a new-type wrapper aroundOption<Document>. Calling this amounts toNoneon 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_boundingthat takes aUseElementBoundingOptions. Seeuse_element_boundingfor how to use. - Reactive element’s hover state.
- Version of
use_element_hoverthat takes aUseElementHoverOptions. Seeuse_element_hoverfor how to use. - Reactive size of an HTML element.
- Version of
use_element_sizethat takes aUseElementSizeOptions. Seeuse_element_sizefor how to use. - Tracks the visibility of an element within the viewport.
- Version of
use_element_visibilitywith that takes aUseElementVisibilityOptions. Seeuse_element_visibilityfor how to use. - Use EventListener with ease.
- Version of
use_event_listenerthat takesweb_sys::AddEventListenerOptions. See the docs foruse_event_listenerfor how to use. - Reactive EventSource
- Version of
use_event_sourcethat takes aUseEventSourceOptions. Seeuse_event_sourcefor how to use. - Reactive favicon.
- Reactive Geolocation API.
- Demo
- Infinite scrolling of the element.
- Version of
use_infinite_scrollthat takes aUseInfiniteScrollOptions. Seeuse_infinite_scrollfor how to use. - Reactive IntersectionObserver.
- Version of
use_intersection_observerthat takes aUseIntersectionObserverOptions. Seeuse_intersection_observerfor how to use. - Reactive counter increases on every interval.
- Wrapper for
set_intervalwith controls. - Reactive
Intl.NumberFormat. - Reactive locale matching.
- Reactive locales.
- Version of
crate::use_localesthat takes aUseLocalesOptions. Seecrate::use_localesfor how to use. - Reactive Media Query.
- Reactive mouse position
- Reactive mouse position related to an element.
- Version of
use_mouse_in_elementthat takes aUseMouseInElementOptions. Seeuse_mouse_in_elementfor how to use. - Reactive MutationObserver.
- Version of
use_mutation_observerthat takes aUseMutationObserverOptions. Seeuse_mutation_observerfor how to use. - Reactive Permissions API.
- Reactive prefers-contrast media query.
- Reactive dark theme preference.
- Version of
crate::use_preferred_darkthat accepts aUsePreferredDarkOptions. - Reactive reduced motions preference.
- Version of
crate::use_prefers_reduced_motionthat takes aUsePrefersReducedMotionOptions. Seecrate::use_prefers_reduced_motionfor 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_observerthat takes aweb_sys::ResizeObserverOptions. Seeuse_resize_observerfor how to use. - Reactive scroll position and state.
- Version of
use_scrollwith options. Seeuse_scrollfor how to use. - Reactive ServiceWorker API.
- Version of
use_service_workerthat takes aUseServiceWorkerOptions. Seeuse_service_workerfor how to use. - Reactive sort of iterable
- Version of
use_sortedwith a compare function. - Version of
use_sortedby key. - SSR compatibe
is_supported - Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.
- Version of
use_throttle_fnwith an argument for the throttled function. See the docs foruse_throttle_fnfor how to use. - Version of
use_throttle_fn_with_argwith throttle options. See the docs foruse_throttle_fnfor how to use. - Version of
use_throttle_fnwith throttle options. See the docs foruse_throttle_fnfor how to use. - Wrapper for
setTimeoutwith controls. - Reactive current timestamp.
- Version of
use_timestampthat returns controls. Seeuse_timestampfor how to use. - Version of
use_timestampthat takes aUseTimestampOptionsand returns controls. Seeuse_timestampfor how to use. - Reactive
ToString::to_string(). - A boolean switcher with utility functions.
- Reactive
mediaDevices.getUserMediastreaming. - Reactive Notification API.
- Version of
use_web_notificationwhich takes anUseWebNotificationOptions. - Creating and managing a Websocket connection.
- SSR safe
window(). This returns just a new-type wrapper aroundOption<Window>. Calling this amounts toNoneon the server andSome(Window)on the client. - Reactively track window focus with
window.onfocusandwindow.onblurevents. - Reactive window scroll.
- watch
Deprecated - A debounced version of
watch. - Pausable
watch. - A throttled version of
leptos::watch. - A version of
leptos::watchbut with additional options. - Shorthand for watching a signal to be
true.