Page Source
A backend-agnostic contract for paged data (PageSource, PageRequest, PageResult), the kit adapters are built with, an in-memory arraySource, and createPageController, which derives the request, resets paging, debounces search, syncs the URL and writes the live region's status. Backend adapters are items of their own: page-source-rest, page-source-spring, page-source-cursor, page-source-relay and page-source-link.
Example
- Ada 1
- Grace 2
- Alan 3
- Edsger 4
- Barbara 5
Installation
Adapters
Each adapter is an item of its own that brings page-source along. Install only the ones your backend needs.
Page Source REST
page-source-restCopy codePage Source Spring
page-source-springCopy codePage Source Cursor
page-source-cursorCopy codePage Source Relay
page-source-relayCopy codePage Source Link
page-source-linkCopy code
Usage
Wrap your endpoint in the adapter that matches its paging, once per resource; components and hooks only see the PageSource. Each adapter is its own item: install only the one your backend speaks.
API reference
This item exports functions and types rather than components.
Other exports
abortErroradapterSourceappendParamscapPageSizecapPageSizescursorPositionOfformatCountHttpErrorisAbortErrorisPagePositionpageCountOfpageNumberOfpageRangepageStatusLabelsreadJsonresolveNavigationrestCallOftotalOfwriteSortarraySourcecreatePageControllertype AdapterIdentitytype CursorPositiontype Navigationtype NavigationModetype PagePositiontype PageRangetype PageRequesttype PageResulttype PageSourcetype PageStatusLabelstype ParamsInittype ParamValuetype RestCalltype RestSourceOptionstype SortDirectiontype SortSpectype SortStyletype SourceCapabilitiestype SourceContexttype TotalInfotype ArraySortValuetype ArraySourceOptionstype PageCodecLiketype PageControllertype PageControllerOptionstype PageControllerStatetype UrlAdapterLiketype UrlHistoryAgent actions
Nothing of its own: the table, list and combobox built on it expose paging, sorting and filtering by name.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.