Query State
Table query state is the shape passed to onTableQueryChange and converted into provider query params for server mode.
Query state shape
TS
export type FluiKitTableQueryState = {
search?: string;
filters?: Record<string, unknown>;
sort?: {
key: string;
direction: "asc" | "desc";
};
page: number;
pageSize: number;
};Provider query mapping
tableQueryToProviderQuery() maps table query state into a plain query object.
| Query state | Provider query |
|---|---|
search | table.search.param or search |
filters | Spread into the query object. |
sort.key | sort |
sort.direction | order |
page | table.pagination.pageParam or page |
pageSize | table.pagination.pageSizeParam or pageSize |
Example
TS
export const usersSchema = {
resource: "users",
table: {
mode: "server",
search: {
enabled: true,
param: "q"
},
filters: [
{ key: "status", label: "Status", type: "select" }
],
sort: {
defaultKey: "name",
defaultDirection: "asc"
},
pagination: {
enabled: true,
pageParam: "page",
pageSizeParam: "limit"
},
columns: ["name", "email", "status"]
}
} as const;JSON
{
"q": "ada",
"status": "active",
"sort": "name",
"order": "asc",
"page": 1,
"limit": 10
}Initial values
Pagination starts from:
table.pagination.page, default1.table.pagination.pageSize, default10.
Sorting starts from table.sort.defaultKey and table.sort.defaultDirection when configured.