Skip to main content

euv_ui/component/pagination/view/
struct.rs

1use super::*;
2
3/// One side of the [`euv_pagination`] prev/next footer.
4#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
5pub struct EuvPaginationItem {
6    /// The display text.
7    #[get(type(copy))]
8    pub text: &'static str,
9    /// The link target (hash route path).
10    #[get(type(copy))]
11    pub link: &'static str,
12}
13
14/// Props for the [`euv_pagination`] component.
15#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
16pub struct EuvPaginationProps {
17    /// The label above the previous entry (for example `Previous`).
18    #[get(type(copy))]
19    pub prev_label: &'static str,
20    /// The label above the next entry (for example `Next`).
21    #[get(type(copy))]
22    pub next_label: &'static str,
23    /// The previous entry; `None` renders a spacer.
24    #[get(type(copy))]
25    pub prev: Option<EuvPaginationItem>,
26    /// The next entry; `None` renders a spacer.
27    #[get(type(copy))]
28    pub next: Option<EuvPaginationItem>,
29}