pub struct Pagination { /* private fields */ }Expand description
Pagination component for navigating through pages
Styled like shadcn/ui Pagination with previous/next buttons and page numbers.
§Example
use armas_basic::Pagination;
let resp = Pagination::new(1, 10).show(ui);
// current_page is the current page after any user interactionImplementations§
Source§impl Pagination
impl Pagination
Sourcepub fn new(initial_page: usize, total_pages: usize) -> Self
pub fn new(initial_page: usize, total_pages: usize) -> Self
Create a new pagination component
§Arguments
initial_page- Initial/current page (1-indexed)total_pages- Total number of pages
Sourcepub const fn sibling_count(self, count: usize) -> Self
pub const fn sibling_count(self, count: usize) -> Self
Set the number of sibling pages to show on each side of current page
Sourcepub const fn show_prev_next(self, show: bool) -> Self
pub const fn show_prev_next(self, show: bool) -> Self
Show or hide previous/next buttons
Set the size of page number and ellipsis buttons
Sourcepub fn show(self, ui: &mut Ui) -> PaginationResponse
pub fn show(self, ui: &mut Ui) -> PaginationResponse
Show the pagination and return PaginationResponse
Auto Trait Implementations§
impl Freeze for Pagination
impl RefUnwindSafe for Pagination
impl Send for Pagination
impl Sync for Pagination
impl Unpin for Pagination
impl UnsafeUnpin for Pagination
impl UnwindSafe for Pagination
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more