Skip to content
Eskais UI

Server data

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

Loading…

Installation

npx shadcn@latest add @eskais/server-list

Usage

Import
import { ServerList, serverListLabels } from "@/components/ui/server-list"

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

PropTypeDefault
aria-labelrequiredNames the list, for screen readers and agents.string–
sourcerequiredPageSource<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–
filtersS–
toolbarFilter UIs of your own; by default a `FilterSearch` when the schema has a text field.ReactNode–
defaultFiltersFilterValues<S>–
sortreadonly SortSpec[]–
pageSizeRows per request. Default 50.number50
infiniteLoads the next page as the end of the list scrolls into view, beside the Load more button. Default true.booleantrue
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 | falsefalse
refetchIntervalInBackgroundKeeps polling while the document is hidden, as the hooks' `refetchIntervalInBackground`. Default false.booleanfalse
controllerPageController<FilterValues<S>>–
labelsrequiredServerListLabels–
localeFormats the counts; the page's `<html lang>` by default (`useLocale`).string–
classNamestring–

Also takes Pick< ListProps<T>, "variant" | "value" | "defaultValue" | "onValueChange" | "onSelect" | "virtualize" | "estimateSize" >.

Other exports

serverListLabelstype ServerListLabelstype ServerListProps

Accessibility

  • 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.