Skip to main content

Crate orbital_paging

Crate orbital_paging 

Source
Expand description

Shared paging primitives for Orbital apps.

This crate provides Page and PageRequest — the canonical wire types for offset/limit pagination across all [leptos] server functions. Because it has no UI or framework dependencies, any crate in the workspace can depend on it without introducing cycles.

When the leptos feature is enabled, this crate also provides [use_paged_infinite_scroll] — a reusable hook that encapsulates the 4-signal + use_infinite_scroll callback pattern for paginated lists.

§Example

use orbital_paging::{Page, PageRequest};

let request = PageRequest::new(0, 10);
assert_eq!(request.offset, 0);
assert_eq!(request.limit, 10);

let page: Page<String> = Page {
    items: vec!["a".into(), "b".into()],
    has_more: false,
    total_count: Some(2),
    next_request_offset: None,
};
assert!(!page.has_more);

Structs§

FilterQuery
Structured filter query on the wire.
FilterRuleParam
Single filter rule on the wire.
Page
A single page of results returned by a server function.
PageRequest
Client-to-server pagination and query parameters.
SortParam
Single sort column on the wire.

Enums§

FilterLogicWire
How multiple filter rules combine on the wire.
SortDirectionWire
Sort direction on the wire.