Skip to main content

leptos_use_element_bounding/
options.rs

1use default_struct_builder::DefaultBuilder;
2
3/// Options for [`use_element_bounding_with_options`](crate::use_element_bounding_with_options).
4#[derive(DefaultBuilder)]
5pub struct UseElementBoundingOptions {
6    /// Reset values to 0 on component disposal
7    ///
8    /// Default: `true`
9    pub reset: bool,
10
11    /// Listen to window resize event
12    ///
13    /// Default: `true`
14    pub window_resize: bool,
15
16    /// Listen to window scroll event
17    ///
18    /// Default: `true`
19    pub window_scroll: bool,
20
21    /// Immediately call update
22    ///
23    /// Default: `true`
24    pub immediate: bool,
25}
26
27impl Default for UseElementBoundingOptions {
28    fn default() -> Self {
29        Self {
30            reset: true,
31            window_resize: true,
32            window_scroll: true,
33            immediate: true,
34        }
35    }
36}