apps/design-system/content/docs/ui-patterns/tables.mdx
Tables are a fundamental pattern for displaying structured data in rows and columns. They provide a scannable, organized way to present collections of related information, making it easy for users to compare values, identify patterns, and take action on specific items.
The choice of table pattern depends on several factors: the complexity of the data, the level of interactivity required, the amount of data being displayed, and the context within the page layout.
There are three main table patterns, each suited to different use cases:
Use Table when:
Use Data Table when:
Use Data Grid when:
Data Table and Data Grid are both pattern components: they are composed from primitives and built per use case. They are not available as standalone components.
Table is designed for simple, static tabular data presentation. It is a presentational wrapper around the HTML <table> element. Use it when:
Data Table is a pattern component and is not exposed as a Design System component. It is built on top of Table and TanStack Table.
Data Table extends Table with column definitions and row models (via TanStack) for complex sorting, filtering, and row actions. Use it when:
Data Table does not yet support virtualization, resizable columns, or advanced editors. These capabilities are planned as part of consolidation with Data Grid.
<ComponentPreview name="data-table-demo" peekCode wide />As you can see from the above example, Data Table’s composition is heavily dependent on use case. We do not yet have a shared Design System component for this reason.
Follow Shadcn’s Data Table documentation for a complete guide on building upon the Data Table pattern for each specific use case. These patterns map closely to the approaches we follow internally.
Data Grid is a pattern component and is not exposed as a Design System component. It is based on React Data Grid and originally adopted for areas including Studio’s Table Editor, Query Performance, and other high-interaction surfaces.
Use it only when you need virtualization, column resizing, or complex cell editing. Otherwise Data Table is simpler and more flexible.
<ComponentPreview name="data-grid-demo" peekCode wide />Data Table and Data Grid overlap significantly. We’re looking at consolidating these into one data table component, which will likely be improvements to Data Table given the numerous advantages of TanStack Table and difficulties extending React Data Grid.
The likely direction is a single Data Table component built on TanStack Table, with