YYayaw

Guide

Server-side & Server Actions

Using Server Actions for list, create, update, delete and bulk operations

How it works

1. State in the URL – Sort, filters, pagination, and column visibility are stored in the URL (via Nuqs). The client reads these and calls your data layer with the same parameters. 2. getTableActions(tableType) – You ret...

Next.js Server Actions example

1. Server module (optional but recommended) Keep your data logic in a server-only module (e.g. lib/products-server.ts): listing with filter/sort/paginate, create, update, delete, and bulk operations. This file must only...

list params shape

The list action receives a single object with: | Key | Type | Description | |-----|------|-------------| | page | number | 1-based page index. |

What this page covers

Guide outline

The original MDX source has been condensed into CMS-native cards so the page can be edited and republished from the control plane.

How it works

1. State in the URL – Sort, filters, pagination, and column visibility are stored in the URL (via Nuqs). The client reads these and calls your data layer with the same parameters. 2. getTableActions(tableType) – You ret...

Next.js Server Actions example

1. Server module (optional but recommended) Keep your data logic in a server-only module (e.g. lib/products-server.ts): listing with filter/sort/paginate, create, update, delete, and bulk operations. This file must only...

list params shape

The list action receives a single object with: | Key | Type | Description | |-----|------|-------------| | page | number | 1-based page index. |

Server-side mode (default)

YaYaw Table always runs filtering, pagination, and sorting in server-side mode. No manual flags are required in table config. Your list action should handle search, filters, advancedFilters, orderBy, page, and limit.

Example app

The /example route currently runs in local mode, so edits persist locally without a backend: it uses app/[locale]/example/lib/products-local-actions.ts with browser localStorage persistence. Server Action reference file...

Implementation notes

Keep moving through the Table docs

Sort, filters, pagination and column state in the URL with Nuqs

$ const productsStore = [...initialProducts];

$ export async function listProducts(params: {

$ page?: number;

$ limit?: number;

$ filters?: Record<string, unknown>;