use ui::{icons::glyph, pagination::{self, Slot}};
pagination::pagination()
.child(div().id("prev").on_click(prev).child(pagination::step(&theme, glyph::ChevronLeft, page > 1)))
.children(pagination::window(page, total, 2).into_iter().enumerate().map(|(slot, entry)| match entry {
Slot::Gap => pagination::ellipsis(&theme).into_any_element(),
Slot::Page(n) => pagination::page_button(&theme, n, n == page)
.id(("page", slot))
.on_click(cx.listener(move |view, _, _, cx| view.go_to_page(n, cx)))
.into_any_element(),
}))
.child(div().id("next").on_click(next).child(pagination::step(&theme, glyph::ChevronRight, page < total)))Components / Content
Pagination
Markdown crates/ui/src/pagination.rs docs.rs
Ask your agent
Install the bezel skill once
npx skills add crabtalk/bezel --skill bezelThen ask
Add page controls under the search results, which the API returns 50 at a time, showing "1 … 4 5 [6] 7 8 … 20".