DocsExamples

Examples

Remote Data Fetching Example

An example of Shadcn Table which shows how to fetch remote data and filter and paginate on a remote server

You will most likely be using a remote data source for your table, which is fully supported. Here is an example of data being fetched from a remote server but also filtered, paginated, and sorted on the server.

Also, be sure to check out the Server-Side Pagination Example, which is very similar to this one, except it uses react-query to simplify much of the state management needed for fetching data, so that you don't need to fetch from a useEffect hook.

Try it

  1. Click page 2. The server sends rows 11 to 20.
  2. Click First Name and choose Sort ascending. The server sorts all 200 rows.
  3. Tick a row, go to page 3 and back. The row is still ticked.
Storybook