TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/IzumiSy/seizen-table/llms.txt
Use this file to discover all available pages before exploring further.
useRemoteData hook is a minimal utility for managing remote data state with SeizenTable. It handles loading states, errors, and cursor-based pagination while keeping pagination, sorting, and filtering logic in the table itself.
Installation
Import
Design Philosophy
This hook intentionally manages only data-related state:data- The array of items to displayloading- Loading state indicatorerror- Error statetotalCount- Total number of items (for pagination)cursors- Cursor storage for cursor-based pagination
useSeizenTable. This avoids state duplication and keeps the API simple.
Use useSeizenTableEvent to react to table state changes and trigger data fetching.
Basic Usage
API Reference
useRemoteData
State Properties
The current data array to display in the table
Loading state indicator
Current error state, if any
Methods
Set the data and optionally update total count or store a cursor for the current page
Set the loading state
Set the error state
Returns remote options object to pass to
useSeizenTableGet the stored cursor for a specific page index (for cursor-based pagination)
Clear all stored cursors (useful when filters or sorting changes)
Offset-Based Pagination
For traditional offset-based pagination:Cursor-Based Pagination
For cursor-based pagination (e.g., GraphQL, some REST APIs):With Sorting and Filtering
Combine remote data with sorting and filtering:Error Handling
Display errors to users:Complete Example
Tips
The
remote.getRemoteOptions() method returns configuration that tells the table it’s in remote mode, enabling proper pagination controls.