Skip to content

ChronicStone/nuxt-ui-tools / skills/consumer/table

nuxt-ui-tools-table

Verified

Use this skill when building or debugging table usage with nuxt-ui-tools as a package consumer. Covers defineTableSchema, useTable, DataList, granular composition, columns, filters, sorting, offset or cursor loading, layouts, summary rows on phones, first-use empty states, actions, selection, accessible row names, context, and URL state with concrete examples.

FileKindSize
SKILL.mdskill md3.6 KB
references/actions.mdmarkdown7.7 KB
references/columns.mdmarkdown4.1 KB
references/context.mdmarkdown1.3 KB
references/data-modes.mdmarkdown2.9 KB
references/filters.mdmarkdown17.7 KB
references/getting-started.mdmarkdown1.4 KB
references/groups.mdmarkdown2.1 KB
references/layouts.mdmarkdown6.7 KB
references/overview.mdmarkdown1.2 KB
references/pagination.mdmarkdown2.5 KB
references/patterns.mdmarkdown989 B
references/schema-surface.mdmarkdown1.3 KB
references/selection.mdmarkdown3.3 KB
references/slots.mdmarkdown11.0 KB
references/sorting.mdmarkdown480 B
references/tree.mdmarkdown3.9 KB
references/url-state.mdmarkdown1.6 KB

references/pagination.md

View on GitHub
# Table Pagination

The schema supports numbered offset pages, cursor-backed incremental loading, and complete unpaginated results. Omitted pagination keeps the existing offset behavior.

## Offset pagination

```ts
pagination: {
  mode: 'offset',
  defaultSize: { table: 20, grid: 12 },
  sizeOptions: { table: [20, 50, 100], grid: [12, 24, 48] },
  showPageSizePicker: true,
  showPagesList: true,
  showPagesCount: true,
}
```

The source receives `{ mode: 'offset', pageIndex, pageSize, count: 'exact' }`. Page and size remain URL-backed as `?p.page=3&p.size=50`, and `<UiDataListPagination />` renders the numbered footer.

The footer names every control in the locale: the first, previous, next, and last buttons ("Première page", "Page précédente", ...) and each page ("Page 2 sur 3"). Below `md` it collapses to a range, a compact previous/next pager with a "1 / 3" indicator, and, while summary rows are available, the view toggle between them. Replace the toggle with the footer's `view-toggle` slot.

## Cursor pagination

Cursor mode is for remote sources and accumulates pages with TanStack Query. The request and response are structurally compatible with Drizzle Resource 2.0 without adding it as a dependency.

```ts
const schema = defineTableSchema({
  tableKey: 'employees',
  rowKey: 'id',
  pagination: { mode: 'cursor', pageSize: 24, count: 'none' },
  source: tableSource({
    mode: 'remote',
    query: (request) => ({
      queryKey: ['employees', request],
      queryFn: async () => api.listEmployees(request),
    }),
  }),
})
```

Each request contains:

```ts
{
  mode: 'cursor',
  cursor: string | null,
  pageSize: 24,
  count: 'none' | 'exact',
}
```

Return one page at a time:

```ts
{
  rows,
  pageInfo: {
    mode: 'cursor',
    pageSize: 24,
    nextCursor: 'opaque-cursor-or-null',
    count: 'none',
    rowCount: null,
  },
}
```

Use `<UiDataListInfiniteLoader />` inside `<UiDataListContent>` for automatic loading, or set `:auto="false"` for a load-more button. Cursor values and accumulated pages are never written to the URL. Changing search, filters, sorting, or page size resets accumulation to a null cursor.

`table.data.loadedRowCount` is always the rendered row count. `table.data.totalRowCount` is `null` with `count: 'none'` and the exact filtered total with `count: 'exact'`.

## No pagination

```ts
pagination: false
```

The source receives `{ mode: 'none' }`. Client data is not sliced, no `p.*` URL keys are created, and neither the numbered footer nor infinite loader renders.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall