suiss/ui ยท Pattern
Paged List
A list that pages through items with numbered pagination on desktop and a Load more button on mobile.
Paged List is an open-source pattern from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
PagedList slices an array of items into pages and renders each one through renderItem inside a plain list. On desktop it shows a suiss/ui Pagination. On mobile (below 48rem, via useIsMobile), the list grows instead of paging: a Load more button appends the next page of items.
Use it for long feeds, search results or topic lists where the user moves through a known set of items.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
-
Add the
cnhelper. -
Add the pieces it builds on: Button, Pagination,
use-mobile. -
Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Examples
Start on later page
Set defaultPage to open on a later page, here page 4.
Single page
The pagination is hidden when every item fits on one page.
Page links
Pass getPageHref to give each page link a real href. Links still update the page on click.
Custom labels
Use previousLabel, nextLabel and loadMoreLabel to replace the previous, next and Load more labels. The previous and next labels also become the links' accessible names.
Controlled
Control the current page with page and onPageChange.
Accessibility
- Items render in a
ul, each inside its ownli. - The desktop pagination is a navigation landmark; the current page link has
aria-current="page". - Previous and next links get
aria-disabledon the first and last page. Their default accessible names are Go to previous page and Go to next page. - Changing pages scrolls the list into view. Loading more on mobile moves focus to the first focusable element of the first new item.
API Reference
PagedList
The root that renders the visible items and the pagination or Load more control.
| Prop | Type | Default |
|---|---|---|
items | T[] | Required |
pageSize | number | 10 |
page | number | - |
defaultPage | number | 1 |
onPageChange | (page: number) => void | - |
getPageHref | (page: number) => string | - |
getKey | (item: T, index: number) => React.Key | (_, index) => index |
renderItem | (item: T, index: number) => React.ReactNode | Required |
loadMoreLabel | string | "Load more" |
previousLabel | string | - |
nextLabel | string | - |
listClassName | string | - |
Also accepts the props of React.ComponentProps<"div">.
The current page is uncontrolled by default and starts at defaultPage. Out-of-range page values are clamped between 1 and the page count. Without getPageHref, page links use # and prevent navigation. pageSize is the number of items per page and per Load more step on mobile; the mobile Load more state is internal and independent of page.
renderItem receives the item and its index in items. Its output is wrapped in an li, so return row content such as an Item, not another list item. Provide getKey when items have stable IDs; the default key is the item's index. listClassName applies to the inner list element.
The desktop pagination shows previous and next links, the first and last page, the pages next to the current one, and ellipses for the gaps. Each part sets a data-slot, such as paged-list-item or paged-list-load-more, for styling.
Web preview
PagedList takes the full items array and renders only the first pageSize items. When the user scrolls near the end, or presses the Load more button in the footer, the next page is appended.
Use it for long local lists where rendering everything at once is not needed.
Installation
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Small pages
Uses a pageSize of 3 so pages load sooner.

Single page
Fewer items than one page, so no Load more button appears. The button disappears once every item is shown.
Web preview
Custom labels
Renames the button with loadMoreLabel.
Web preview
Accessibility
- The Load more button is a
Button, so screen reader users can load the next page without scrolling to the end.
API Reference
PagedList
| Prop | Type | Default |
|---|---|---|
items | T[] | Required |
pageSize | number | 10 |
getKey | (item: T, index: number) => React.Key | (_, index) => index |
renderItem | (item: T, index: number) => React.ReactNode | Required |
loadMoreLabel | string | "Load more" |
className | string | - |
listClassName | string | - |
Also accepts the props of FlatListProps<T>.
Pass a getKey that returns a stable key for each item; it defaults to the index. renderItem receives the item and its index, not the FlatList info object. pageSize is the number of items added per page. The list manages data, keyExtractor, onEndReached and ListFooterComponent, so those do not pass through. className styles the FlatList and listClassName its content container.
The next page loads when the scroll position is within half a screen of the end (onEndReachedThreshold of 0.5). The footer is a full-width secondary button.
PagedList
The root that renders the visible items and the pagination or Load more control.
| Parameter | Type | Default |
|---|---|---|
_ย items | [Item] | - |
id | KeyPath<Item, ID> | - |
pageSize | Int | 10 |
loadMoreLabel | LocalizedStringKey? | "Load more" |
loadsOnEndReached | Bool | true |
row | (Item, Int) -> Row | - |
Overloads: init(_:id:pageSize:loadMoreLabel:loadsOnEndReached:row:), init(_:pageSize:loadMoreLabel:loadsOnEndReached:row:).
PagedList
The root that renders the visible items and the pagination or Load more control.
| Parameter | Type | Default |
|---|---|---|
items | List<T> | - |
modifier | Modifier | Modifier |
pageSize | Int | 10 |
getKey | ((T, Int) -> Any)? | null |
loadMoreLabel | String | "Load more" |
state | LazyListState | rememberLazyListState() |
contentPadding | PaddingValues | PaddingValues(0.dp) |
renderItem | @Composable (T, Int) -> Unit | - |
