Server List
A List over a PageSource that grows as you scroll: ListItem rows, virtualized past 200, one tab stop with row navigation, the next page when the end comes into view, and a visible Load more button for keyboards and agents.
Example
server-list-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
Use it for a feed or an inbox on a server: rows come in as you scroll, and the button reaches every page.
API reference
ServerList
| Prop | Type | Default |
|---|---|---|
aria-labelrequiredNames the list, for screen readers and agents. | string | – |
sourcerequired | PageSource<T, FilterValues<S>> | – |
renderItemrequired | (item: T, index: number) => ReactNode | – |
itemTextrequiredA row's text, for agents and find in page while it isn't rendered. | (item: T) => string | – |
filters | S | – |
toolbarFilter UIs of your own; by default a `FilterSearch` when the schema has a text field. | ReactNode | – |
defaultFilters | FilterValues<S> | – |
sort | readonly SortSpec[] | – |
pageSizeRows per request. Default 50. | number | 50 |
infiniteLoads the next page as the end of the list scrolls into view, beside the Load more button. Default true. | boolean | true |
refetchIntervalReloads the shown rows every so many ms while the document is visible, as the hooks' `refetchInterval`: the rows stay, unmarked, and the status announces nothing. Default false. | number | false | false |
refetchIntervalInBackgroundKeeps polling while the document is hidden, as the hooks' `refetchIntervalInBackground`. Default false. | boolean | false |
controller | PageController<FilterValues<S>> | – |
labelsrequired | ServerListLabels | – |
localeFormats the counts; the page's `<html lang>` by default (`useLocale`). | string | – |
className | string | – |
Also takes Pick< ListProps<T>, "variant" | "value" | "defaultValue" | "onValueChange" | "onSelect" | "virtualize" | "estimateSize" >.
Other exports
serverListLabelstype ServerListLabelstype ServerListPropsAccessibility
- Rows are one tab stop with arrows and j/k, virtualized past 200 rows without losing find in page.
- New rows never take focus; Load more keeps it while it loads and once there is no more.
- A polite status says how many rows are shown after each load.
Agent actions
Agents select a row through the list's select(id) and press Load more by name.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.