DocsExamples

Examples

Lazy Sub-Rows Example

A Shadcn Table example showing how to use expandable rows to fetch additional sub-rows data only after the user expands the row.

If you have a ton of nested data that you want to display, but you don't want to fetch it all up front, you can set up Shadcn Table to only fetch the sub-rows data when the user expands the row.

There are quite a few ways in which you could implement fetching sub-rows lazily. This example is just one way to do it.

This example combines concepts from the Server-Side Pagination Example and the Expanding Parsed Tree Example.

Try it

  1. Click the arrow on Henry Lynch. Molly Purdy loads from the server below him.
  2. Click the arrow on Molly Purdy. Her reports load below her.
Storybook