Skip to content
Eskais UI

Guides

Server data

Tables, lists and comboboxes over any backend: one contract for paging, one schema for filters, adapters and serializers for each wire format.

Four layers, no backend assumed

  • A PageSource is the contract: fetchPage(request, { signal }) returns rows and whatever the backend knows (a total, an estimate, hasMore, cursors). An adapter per wire format builds one from your request function; none of them fetches by itself or depends on a backend library.
  • A filter schema declares the filters once. It types the values, drives the filter UIs, keeps them in the URL, and is the whitelist the serializers check every field against.
  • Server data hooks run on TanStack Query, which never shows in their types: previous rows stay while the next page loads, superseded requests are aborted, a 4xx is never retried.
  • Components: ServerDataTable, ServerList and ServerCombobox, with the filter UIs FilterSearch, FilterChips and FilterPanel.

ServerDataTable brings the filter schema and the PageSource contract. The adapter for your backend's paging and the serializer for its query language are items of their own, so add only the ones it speaks: here a Spring controller that reads an RSQL filter. The tables below name the item for each.

Terminal
npx shadcn@latest add @eskais/server-data-table @eskais/page-source-spring @eskais/filter-rsql
tasks-page.tsx
import { ServerDataTable } from "@/components/ui/server-data-table"import { defineFilters, searchTerms, toFilterAst } from "@/lib/filter-schema"import { rsql } from "@/lib/filter-rsql"import { readJson } from "@/lib/page-source"import { springPageSource } from "@/lib/page-source-spring"import { hashUrlState } from "@/lib/url-state"
const taskFilters = defineFilters({  q: { kind: "text", label: "Search" },  status: { kind: "options", label: "Status", multiple: true, options: statusOptions },  created: { kind: "dateRange", label: "Created" },})
// One adapter per endpoint: here a Spring controller taking Pageable and an RSQL filter.const tasks = springPageSource<Task, FilterValues<typeof taskFilters>>({  key: ["tasks"],  getId: (task) => task.id,  params: (filter) => ({ ...searchTerms(taskFilters, filter), filter: rsql(toFilterAst(taskFilters, filter)) || undefined }),  request: ({ query, signal }) => fetch(`/api/tasks?${query}`, { signal }).then(readJson),})
<ServerDataTable  label="Tasks"  source={tasks}  columns={columns}            // give a column sortField to sort it on the server  filters={taskFilters}  filterUi="chips"             // "search" (default), "chips" or "panel"  urlState={hashUrlState()}    // ?status=open,blocked&created=2026-01-01..2026-01-31&page=2&sort=title.asc  labels={{ errorTitle: "Couldn't load tasks", retry: "Try again", emptyTitle: "No tasks match" }}/>

Pagination styles

StyleThe table showsGood atCostsAdapterItem
Page and size, limit and offsetPage numbers, Showing 21–40 of 312Jump to any page; easy to cache and shareRows drift when others insert; a COUNT per query; deep pages are slowpagedSource({ base }), offsetSourcepage-source-rest
Cursor or keysetLoad more, or infiniteStable and fast at any depthNo jump to page N; needs a unique, ordered keycursorSource (opaque, or keyset)page-source-cursor
RelayLoad more, or previous and nextCursors plus pageInfo and an optional totalCountSame as cursorsrelaySourcepage-source-relay
Link header (RFC 8288)Previous and next, about N from lastNavigation the server already wroteA total only on the last pagelinkHeaderSourcepage-source-link
Spring Page and SlicePage numbers (Page), previous and next (Slice)Pageable controllers as they arePage runs a count query; Slice has no totalspringPageSource, springSliceSourcepage-source-spring

Navigation follows what the source gives (navigation="auto"); pass pages, prev-next, load-more or infinite to choose. A source's fetchTotal runs as its own cached query, so a slow count never holds back the rows.

The source givesThe UI shows
An exact total (or fetchTotal)Page numbers and Showing 21–40 of 312
totalEstimatePrevious and next, Showing 21–40 of about 300
Only hasMorePrevious and next, Showing 21–40
A cursorLoad more, or infinite with navigation="infinite"

Wire formats

FormatGrammarSpoken bySerializerNotesItem
Flat params (DTO, suffix, bracket)and onlyA request DTO, json-server, Django filtersqueryParamsURL-friendly; refuses orfilter-schema
RSQL / FIQLand, or, nestingrsql-jpa-specification, many Java and .NET APIsrsqlCompact; quoted, escaped argumentsfilter-rsql
OData $filterthe full grammarASP.NET OData, SAP, DynamicsodataVerbose; dates unquotedfilter-odata
Spring Filterand, or, notturkraft/springfilterspringFilterJava only; refuses wildcards in textfilter-spring
JSON ASTthe full grammarA POST body for any backendjsonAstSafest: nothing to escapefilter-schema
GraphQL wheretyped, nestedHasura, PrismagraphqlWhereGoes in variables, never in the queryfilter-graphql
q onlyfree textA search endpointsearchOnlyIgnores every other fieldfilter-schema
  • Field names come only from the schema, never from what someone types, and every serializer checks them again.
  • Each serializer escapes per its grammar (RSQL and Spring Filter backslashes, OData doubled quotes, LIKE escapes for Hasura) or throws a FilterSerializeError for a value it can't write safely, like a wildcard inside a text match. The table then shows its error state instead of sending a broken query.
  • Dates go out as ISO 8601 unless you pass dates: "iso-date" | "epoch-ms" | fn; strings, Date and Temporal values all work. A date range's end is inclusive: lte the last day, or end: "next-day" for lt the day after when the backend stores date-times.

Latency and errors

arraySource pages an array in memory with delay and fail, for demos, tests and mockups. Page through this table, then switch failures on: the previous rows stay while a page loads, the status says "Loading…" only past 400 ms, and an error offers a retry instead of an empty table.

Status

One table, three backends

The same tasks behind a page-and-size API with a total, keyset cursors and a Spring Page. Filter, sort and page, and watch the request each adapter sends and the filter in every wire format.

Status
Request the adapter sent
…
The filter in this wire format
filter=status%3Din%3D%28%22open%22%2C%22blocked%22%29

The URL

urlState takes hashUrlState(), historyUrlState() or your router wrapped in the same three methods. The URL keeps schema values, not the wire format, in readable params, and falls back to one encoded f param when a filter has or groups. Writes replace the entry by default; history: "push-page" adds one per page so Back steps through them.

Hooks and mutations

const { state, controller } = usePageController(tasks, { search: { key: "q" }, url: { adapter, codec } })const page = useServerPage(tasks, state.request)// page.items, page.status ("pending" | "error" | "success"), page.fetching, page.total, page.navigation, page.retry
const rename = useSourceMutation({  source: tasks,  mutationFn: (change: { id: string; title: string }) => api.rename(change),  optimistic: (items, change) => items.map((task) => (task.id === change.id ? { ...task, title: change.title } : task)),})

The hooks use your app's QueryClient when it has one, and a shared default otherwise. DataProvider provides the registry's defaults: two retries except on a 4xx, read from the error's status (readJson throws an HttpError with it), 30 s fresh, no refetch on focus. Mount one per request when rendering on a server.

Resources that aren't paged

useServerQuery(key, fetch, options) loads one resource and returns what the page hooks return, with data in place of the rows: status, fetching, previous, error and retry. fetch gets the signal, aborted when the key changes or the component unmounts. It takes enabled, staleTime, placeholder and keepPrevious (off by default, so a detail never shows another id's data). On a server it renders pending, or the data the request's client already holds.

import { useServerQuery } from "@/components/ui/use-server-query"
// A detail, a snapshot or a short list: no paging. Its key sits under the source's, so the hooks below reach it.const detail = useServerQuery([...tasks.key, "detail", id], ({ signal }) => api.task(id, { signal }))// detail.data, detail.status, detail.fetching, detail.previous, detail.error, detail.retry
// The server answers with the saved task: write it everywhere, with no optimistic step and no refetch.const save = useSourceMutation({  source: tasks,  mutationFn: (change: TaskChange) => api.save(change), // resolves to the saved Task  settleItems: (items, saved) => items.map((task) => (task.id === saved.id ? saved : task)), // pages, infinite lists  settle: (saved, _change, current) => (current?.id === saved.id ? saved : undefined), // useServerQuery; undefined skips})
// A command whose failure changes nothing on the server: no reload when it fails.const archive = useSourceMutation({ source: tasks, mutationFn: api.archive, settle: () => undefined, refreshOnError: false })
// A reload the caller hears about when it fails.const reload = useInvalidateSource(tasks, { throwOnError: true })reload().catch(() => toast.error("Couldn't reload tasks"))
  • settleItems(items, result, variables) maps each page's rows, in page and infinite queries; totals stay. settle(result, variables, current, queryKey) writes each useServerQuery under the key, and undefined leaves one alone.
  • On success they cancel the read in flight of each query they write, so an answer sent before the change can't overwrite it, and request nothing. The other queries under the key are marked stale and reload when next shown; one that was already loading starts again. They reach every cached query under the key, mounted or not, as one filled with setQueryData. A failed mutation still rolls back optimistic rows and refreshes the key, unless refreshOnError: false says the failure changed nothing.
  • useInvalidateSource(source) resolves once the shown queries have reloaded, failed or not; { throwOnError: true }, on the hook or on one call, rejects with the error instead.
  • Every reload these hooks make (useInvalidateSource, a mutation's refresh after success or failure, and the restart after settle) starts again any read under the key that is in flight, its first load included, since it may have left before the write and answer with the data from before it. The old request's signal aborts, the query stays pending or fetching without an error, and whatever that request resolves or rejects with later is dropped. TanStack's own invalidateQueries joins a first load in flight instead, so invalidate through the hooks.

Writing a change the app learned of elsewhere

When the server tells the app what changed outside a mutation (a push event, a socket message, another request's answer), usePatchSource(source) returns patch(changes, options), which writes it into every cached query under the key, mounted or not, without a request. changes.items(rows) maps the rows of each page and infinite list (totals stay), and changes.resource(current, queryKey) each other query, undefined leaving one alone. patchSource(client, source, changes, options) does the same outside React.

import { patchSource, usePatchSource, type SourcePatch } from "@/components/ui/use-server-data"
// The server told the app a task changed (a push event, another mutation's answer): write it everywhere.const savedTask = (saved: Task): SourcePatch<Task, Task> => ({  items: (rows) => rows.map((task) => (task.id === saved.id ? saved : task)), // pages and infinite lists  resource: (current) => (current?.id === saved.id ? saved : undefined), // useServerQuery; undefined skips})
const patch = usePatchSource<Task, Task>(tasks)await patch(savedTask(saved))
// Or confirm with one reload of the key, resolved once the shown queries have reloaded.await patch(savedTask(saved), { refetch: true })
// Write the answer and stop the reads in flight under the queries it writes, without reading again.await patch(savedTask(saved), { inFlight: "cancel" })
// No new read, but wait for the reads the patch restarted and fail if one does.await patch(savedTask(saved), { awaitRestarted: true, throwOnError: true })
// Outside React, as in a socket handler, on the app's client.socket.on("task", (saved: Task) => void patchSource(client, tasks, savedTask(saved)))
// The call resolves with what it did, by query key: clear an error only when a read ran again.const { restarted, refetched } = await patch(savedTask(saved))if (restarted.length + refetched.length > 0) setLoadError(null)
  • A read in flight under the key left before the change and could answer with the data from before it. So each read whose query the patch writes, and each first read (no data yet, so nothing to patch), is cancelled silently and started again in the same batch, with or without refetch: the number of requests stays the same, nothing is left pending, and the old request's answer or AbortError is dropped. A read of a query the patch leaves alone goes on.
  • { inFlight: "cancel" } cancels the read of each query the patch writes instead of starting it again: the query keeps the patch and stops fetching, as after a mutation's settle, with no mutation. The read's late answer is dropped and nothing shows an error. A first read the patch writes nothing into still starts again, since its query would otherwise stay pending. "restart" is the default.
  • { awaitRestarted: true } resolves once every read the patch started again has settled, following each query through later restarts (another patch, an invalidation) to its latest read, and starts no read of its own. With throwOnError it rejects with the first failure, after retries; an aborted read never counts, and a later inFlight: "cancel" patch settles it with the data it wrote. It is the way to know a restarted read failed without the extra read refetch makes, for a resource whose every read overwrites per-item ETags. Awaiting the query's promise instead rejects with a silent CancelledError whenever another write restarts the read.
  • { refetch: true } reloads the whole key afterwards, as useInvalidateSource does, and the promise resolves once the shown queries have reloaded (throwOnError rejects on a failed reload). That reload restarts every read in flight under the key, so the patch leaves the restart to it rather than sending a request that is aborted at once. By default nothing new is requested and the patched queries count as fresh.
  • The call resolves with what it did, as lists of query keys in the cache's order: written, the queries it wrote; cancelled, those whose read it stopped (inFlight: "cancel"); restarted, those whose read it started again (a written query's under "restart", a first read it left empty, which restarts under "cancel" too, and with refetch every read that was in flight under the key); and refetched, those the refetch reload read that weren't reading. A cancelled query that is shown is read again by refetch, so it is in both. A read ran again when restarted or refetched isn't empty. awaitRestarted waits for exactly the restarted reads. A caller that ignores the result works as before.
  • A patch is what the server holds now. For a change the server hasn't confirmed yet, use useSourceMutation's optimistic, which rolls back on failure.

Cancel now, write later

A screen that fetches the answer itself, with another request than the query's on a first load, must stop the reads in flight before it waits, or one of them lands while it does. useHoldSource(source) returns a function that begins a hold (holdSource(client, source) outside React). The hold cancels every read in flight under the key at once and pauses the hooks' reads under it until it ends: hold.patch(changes, options) writes the answer and ends it, and hold.release() ends it without writing.

import { holdSource, useHoldSource } from "@/components/ui/use-server-data"
const hold = useHoldSource<Task, Task>(tasks)
async function open(id: string) {  // Cancel the reads in flight under tasks now; the hooks' reads wait until the hold ends.  const held = hold()  try {    // Your own request, another endpoint than the resource's query function on a first load.    const task = await api.openTask(id)    // Write the answer and end the hold: a written query's paused read is dropped, the rest run.    await held.patch({      items: (rows) => rows.map((row) => (row.id === task.id ? task : row)),      resource: (current, queryKey) => (queryKey[2] === task.id ? task : undefined),    })  } catch (error) {    // The paused reads run again; after the patch has ended the hold, this does nothing.    held.release()    throw error  }}
// Outside React, on the app's client.const held = holdSource<Task, Task>(client, tasks)
  • A paused read shows as fetching and sends nothing. A read the hold cancelled waits as one, so a first load stays pending and fetching, never pending and idle. A read a mount, a focus or reconnect refetch, a retry or an invalidation starts during the hold waits too, deduplicated as TanStack does.
  • hold.patch is patch with inFlight: "cancel": each query it writes keeps the answer and its paused read is dropped without a request, so a first load gets its first value from the caller. Every other paused read runs then, and is listed in restarted. refetch, awaitRestarted and throwOnError work as on patch, after the hold has ended, so the reload isn't paused.
  • hold.release(), after the caller's fetch failed, lets every paused read run, each once: a first load reads with its own query function and nothing stays pending. It does nothing once the hold has ended. The hook releases the holds its component began when it unmounts. A patch after the hold ended still writes, as a cancelling patch.
  • Holds nest and overlap: a read waits until every hold over its key has ended. A read the hooks don't own (a prefetchQuery) can't wait: the hold cancels it and starts it again when it ends, unless its patch writes that query. hold.cancelled lists the reads it stopped.
  • The hold adds no request: the reads it cancels or pauses either get the caller's answer or run once when it ends, as they would have. Only a read already in flight when the hold begins and that it lets run afterwards is sent twice, the first time aborted.

Reloading on focus, reconnect and mount

refetchOnWindowFocus, refetchOnReconnect and refetchOnMount decide when a query reloads on its own: true when it is stale, "always" even when it is fresh, false never. createDataClient sets the app's defaults (no reload on focus; a stale query reloads on mount, and on reconnect unless networkMode is "always", as in TanStack), and useServerQuery, defineResource, useServerResource, useServerPage, useServerInfinite and useServerTotal take their own. On useServerResource the call's option wins over the definition's, and a page's total follows its page.

import { createDataClient } from "@/components/ui/server-data"import { defineResource, useServerQuery, useServerResource } from "@/components/ui/use-server-query"
// App-wide: reload stale queries on focus too (createDataClient's default is false).const client = createDataClient({ refetchOnWindowFocus: true })
// One query: true reloads it when stale, "always" even when fresh, false never.useServerQuery([...tasks.key, "activity"], api.activity, { refetchOnWindowFocus: "always" })
// A list whose reads overwrite each row's ETag, which a later save sends as If-Match: never reload it behind an edit.// Set it on the definition, so every screen that reads it agrees: one reader that reloads reloads it for all.export const editableTasks = defineResource({  key: (projectId: string) => [...tasks.key, "editable", projectId],  fetch: (projectId: string, { signal }) => api.editableTasks(projectId, { signal }),  refetchOnWindowFocus: false,  refetchOnReconnect: false,})
// A call's option wins over the definition's.useServerResource(editableTasks, projectId, { refetchOnMount: false })

Never reload a resource whose reads overwrite per-item ETags (or versions) that a later write sends back: a read on focus or reconnect while a person edits a row hands them the ETag of a version they never saw, and the save that should have failed with a conflict overwrites it. Set refetchOnWindowFocus: false and refetchOnReconnect: false on its defineResource, since TanStack reloads a query when any hook that reads it asks to, and write each save's answer with settle or patch.

Shared and seeded resources

When two screens read the same resource, declare it once with defineResource (its key, fetch, staleTime and seeds) and read it with useServerResource(resource, params, options). When one answer contains another resource, seeds writes it: after the fetch resolves, unless it was aborted, whether or not that resource is mounted, and never over data written after the fetch started. select picks what data holds, typed as its result, recomputed only when the answer changes and kept by identity when equal; the cache, settle and seeds still see the whole answer.

import { defineResource, useServerResource } from "@/components/ui/use-server-query"
// Declared once, read by every screen: same key, fetch and options, one request.export const taskSummary = defineResource({  key: (id: string) => [...tasks.key, "summary", id],  fetch: (id: string, { signal }) => api.taskSummary(id, { signal }),  staleTime: 60_000,})
// The full task carries the summary: its answer seeds it, mounted or not.export const taskDetail = defineResource({  key: (id: string) => [...tasks.key, "detail", id],  fetch: (id: string, { signal }) => api.task(id, { signal }),  seeds: (task) => [taskSummary.seed(task.id, { id: task.id, title: task.title, status: task.status })],})
const detail = useServerResource(taskDetail, id)const title = useServerResource(taskSummary, id, { select: (summary) => summary.title }) // data: string | undefined
// Without a definition, useServerQuery takes seeds too: a list fills each row's summary.useServerQuery([...tasks.key, "recent"], api.recent, {  seeds: (list) => list.map((task) => taskSummary.seed(task.id, summaryOf(task))),})

Typed errors

error is unknown by default, since a fetch can reject with anything. Register a defaultError with TanStack Query to type it across the app, or pass the error type after the data type; useServerPage, useServerInfinite, useServerTotal and useSourceMutation take it too.

// One error type for the whole app: every hook's error becomes ApiError | null.declare module "@tanstack/react-query" {  interface Register {    defaultError: ApiError  }}
// Or per call: the type parameter after the data.const detail = useServerQuery<Task, ApiError>([...tasks.key, "detail", id], fetchTask)const page = useServerPage<Task, TaskFilter, ApiError>(tasks, request)

Retries

createDataClient({ retry, retryDelay }): a number of retries keeps the 4xx rule, a function (failures, error) => boolean decides alone. The default stays two retries for anything without a 4xx status, because fetch reports a dropped connection as a TypeError with no status. When your errors carry no status (IPC, a domain error, a parse error), retrying only isTransientError fails them at once instead of after the backoff. retry: false never retries, as 0 does. Mutations never retry: a write that failed may still have reached the server.

import { createDataClient, isTransientError } from "@/components/ui/server-data"
// Retry only what may pass next time: a network failure, 408, 425, 429 or a 5xx.const client = createDataClient({  retry: (failures, error) => failures < 3 && isTransientError(error),  retryDelay: (failures) => Math.min(500 * 2 ** failures, 5_000),})

Offline and network mode

TanStack Query's default networkMode, "online", pauses every read and write after the browser fires offline, until it fires online: a read stays pending, never reaching its error state, and a write waits. When the backend is local (Electron IPC, a server on localhost) or the app shows its own offline UI, use "always", on createDataClient for every query and mutation or on one hook: useServerQuery, defineResource and useServerResource, useServerPage, useServerInfinite, useServerTotal and useSourceMutation take networkMode. "offlineFirst" runs the first attempt and pauses only the retries, for a service worker cache. With "always", a stale query no longer reloads when the browser comes back online, as in TanStack; refetchOnReconnect: true keeps it.

import { createDataClient } from "@/components/ui/server-data"
// The backend is the desktop app's own process: the browser's online state says nothing about it.const client = createDataClient({ networkMode: "always" })
// Or per hook: a local read in an app that otherwise waits for the network.useServerQuery(["settings"], readSettings, { networkMode: "always" })

Polling

refetchInterval reloads a query every so many ms while it's shown, on useServerQuery, useServerResource, useServerPage and useServerInfinite, and on ServerDataTable and ServerList. A function of the hook's state decides again after every render and stops the polling once it returns false, so a screen that waits for a login or a job asks only while the answer is pending.

import { useServerQuery } from "@/components/ui/use-server-query"
// Ask every 2 s while the login is pending; stop once it isn't.const login = useServerQuery([...auth.key, "login", attempt], ({ signal }) => api.loginStatus(attempt, { signal }), {  refetchInterval: (state) => (state.data?.status === "pending" ? 2000 : false),})
// A table or list that follows the server, also while the tab is hidden.<ServerDataTable label="Jobs" source={jobs} columns={columns} labels={labels} refetchInterval={10_000} refetchIntervalInBackground />
// With your own status: leave polls out of what it announces.<DataState status={page.status} data={page.items} fetching={page.fetching && !page.polling}>{renderRows}</DataState>
  • The next poll is counted from when the last read settled, so a slow server never gets two requests at once, and any other read of the query (a mutation's refresh, a patch) pushes it back. A hold pauses it like any read.
  • It stops while the document is hidden, and once it's visible again reloads at once when an interval went by. refetchIntervalInBackground keeps it going.
  • A poll is a background refresh: the data stays, fetching and polling are true and status stays success. A failed poll follows the retry rules and keeps the last data beside the error. The table and list don't mark their rows busy or say "Loading…" for a poll; leave polling out of your own status the same way.
  • Screens that read the same key share one timer, at the shortest interval any of them asks for, and it stops when the last one unmounts or moves to another key. With polling off the hooks set no timer.

Mutations one at a time

Mutations with the same scope: { id }, from one useSourceMutation or several, run one at a time in the order they were called: the next starts once the one before has settled, its refresh included (write the answer with settle or settleItems to skip the reload between them). A failure doesn't stop the queue. To stop at the first one, have onError raise a flag that mutationFn reads: a step's mutationFn runs only after the step before has settled. mutationKey finds them with useMutationState or client.isMutating. Different scopes, or none, run side by side.

const failed = useRef(false)const saveStep = useSourceMutation<Step, Step, Step>({  source: steps,  scope: { id: "steps" }, // one at a time, in the order called, from any hook with this scope  mutationKey: ["steps", "save"], // useMutationState({ filters: { mutationKey } }) lists them  refreshOnError: false,  // Runs only once the step before has settled, so its failure is known by then.  mutationFn: (step) => (failed.current ? Promise.reject(new SkippedStep(step)) : api.saveStep(step)),  onError: () => {    failed.current = true  },})
async function saveAll(list: Step[]) {  failed.current = false  const results = await Promise.allSettled(list.map((step) => saveStep.mutateAsync(step)))  if (failed.current) await invalidate() // one reload for the whole run  return results}

Testing

Query results reach React through TanStack Query's notifyManager, which schedules them with setTimeout(0). So when a test awaits one act() around a source settling, the query is done but the component still shows the state before it. Set the scheduler to queueMicrotask in your test setup, or wait with findBy… and waitFor. An arraySource with delay and fail stands in for the backend, and a client with retry: 0 shows an error at once.

tasks.test.tsx
// test/setup.tsimport { notifyManager } from "@tanstack/react-query"
// Deliver query results within the act() that settled them, not one setTimeout(0) later.notifyManager.setScheduler(queueMicrotask)
// a testconst tasks = arraySource(fixtures, { key: ["tasks"] })render(<DataProvider client={createDataClient({ retry: 0 })}><TaskScreen source={tasks} /></DataProvider>)expect(await screen.findByRole("row", { name: /Write the docs/ })).toBeVisible()

Effect

There is no Effect dependency: run a program to a Promise and pass the signal, so a superseded request interrupts its fiber.

import { Effect } from "effect"
const tasks = pagedSource<Task, TaskFilter>({  key: ["tasks"],  getId: (task) => task.id,  request: ({ query, signal }) => Effect.runPromise(fetchTasks(query), { signal }),})
// Or a source by hand: fetchPage is any (request, { signal }) => Promise.const custom: PageSource<Task, TaskFilter> = {  key: ["tasks"],  getId: (task) => task.id,  capabilities: { position: "page", total: "exact" },  fetchPage: (request, { signal }) => Effect.runPromise(loadPage(request), { signal }),}

Accessibility and agents

  • A polite status says what is shown after each load, but not after a poll; focus stays on the control you pressed.
  • Row navigation starts again at the first row without moving focus; new rows never take it.
  • Agents sort and page through the table's own actions and filter by label through its filters group: filter("Status", ["Open"]).