ChronicStone/nuxt-ui-tools / skills/consumer/table
nuxt-ui-tools-table
VerifiedUse 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.6 KB |
| references/actions.md | markdown | 7.7 KB |
| references/columns.md | markdown | 4.1 KB |
| references/context.md | markdown | 1.3 KB |
| references/data-modes.md | markdown | 2.9 KB |
| references/filters.md | markdown | 17.7 KB |
| references/getting-started.md | markdown | 1.4 KB |
| references/groups.md | markdown | 2.1 KB |
| references/layouts.md | markdown | 6.7 KB |
| references/overview.md | markdown | 1.2 KB |
| references/pagination.md | markdown | 2.5 KB |
| references/patterns.md | markdown | 989 B |
| references/schema-surface.md | markdown | 1.3 KB |
| references/selection.md | markdown | 3.3 KB |
| references/slots.md | markdown | 11.0 KB |
| references/sorting.md | markdown | 480 B |
| references/tree.md | markdown | 3.9 KB |
| references/url-state.md | markdown | 1.6 KB |
references/data-modes.md
View on GitHub# Table Data Modes
Current source modes:
- `client`
- `remote`
Wrap either source mode with `tableSource(...)` directly inside `defineTableSchema(...)`. The helper
preserves query-result inference; it is not intended for separately declared, manually typed sources.
## Client Mode
Use client mode when the dataset can be loaded locally and queried in-memory.
Example:
```ts
source: tableSource({
mode: 'client',
query: () => ({
queryKey: ['employees'],
queryFn: async () => [
{ id: '1', fullName: 'Emma Martin', email: 'emma@example.com' },
{ id: '2', fullName: 'Luca Sato', email: 'luca@example.com' },
],
}),
})
```
What you return:
- an array of rows
- or an object with `rows` and `rowCount`
Client mode also includes built-in data-layer execution for:
- filtering
- search
- sorting
- pagination
- facet counts for filters that opt into `source.facet`
## Remote Mode
Use remote mode when filtering, sorting, pagination, or option counts should be server-backed.
Example:
```ts
source: tableSource({
mode: 'remote',
query: (request) => ({
queryKey: ['employees', request],
queryFn: async () => api.queryTable({ request }),
}),
})
```
What your `request` contains:
- pagination
- sorting
- resolved filters
- search
- context
What your API may return for offset pagination:
```ts
// compact table-native shape
{
rows: EmployeeRow[],
rowCount: number
}
// resource-style shape, accepted directly (for example drizzle-resource)
{
rows: EmployeeRow[],
pageInfo: {
mode: 'offset',
pageIndex: number,
pageSize: number,
hasNextPage: boolean,
count: 'exact',
rowCount: number,
},
facets?: TableFacetResult[],
}
```
Cursor sources return the matching `pageInfo: { mode: 'cursor', nextCursor, ... }` shape. This lets
query-resource backends pass their page result straight through without an adapter that only moves
`pageInfo.rowCount` to the root.
Remote mode can also provide:
- remote facets
- remote filter-option queries
Remote facet counts are configured on the filter with `source.facet` and implemented on the source with `source.facets(...)`.
## Route prefetch
Pair a table page with the `defineQueryPrefetch(...)` macro when links should warm the exact
destination state before navigation:
```ts
defineQueryPrefetch('employees', ({ route }) => prefetchTable({ route, schema: employeesSchema() }))
```
`prefetchTable(...)` resolves the route's `l`, `p.*`, `s.*`, and `f.*` query keys and stages context,
source/facet/option, then page-context queries in dependency order. The mounted table reuses the
same TanStack Query cache entries.
## Choosing Between Them
Use client mode for:
- local datasets
- simpler setups
- built-in client-side query behavior
- client-computed facet counts when filters opt into `source.facet`
Use remote mode for:
- large datasets
- server-backed filtering/sorting/pagination
- dynamic facet and option loading
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |