Skip to main content

euv_ui/component/back_top/view/
struct.rs

1use super::*;
2
3/// Props for the [`euv_back_top`] component.
4///
5/// Defines the strongly-typed interface for a back-to-top button: when
6/// it is on screen, what it says, and what happens when it is taken.
7#[derive(Clone, CustomDebug, Default)]
8pub struct EuvBackTopProps {
9    /// Whether the button is on screen.
10    ///
11    /// The caller owns the visibility — it is usually driven by the
12    /// page's scroll offset, through `use_scroll`.
13    pub visible: Signal<bool>,
14    /// The label on the button.
15    pub label: &'static str,
16    /// The callback fired when the button is taken.
17    #[debug(skip)]
18    pub on_click: Option<Rc<dyn Fn(Event)>>,
19}