Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(quill): hide DataTable pager when there are no rows (#64971)

Rafael Audibert10d9466d633b
diff --git a/packages/quill/packages/components/AGENTS.md b/packages/quill/packages/components/AGENTS.md
index 0edea5fcb3a0..5983e08a75d9 100644
--- a/packages/quill/packages/components/AGENTS.md
+++ b/packages/quill/packages/components/AGENTS.md
@@ -35,7 +35,7 @@ Rules:
- Column defs are standard TanStack `ColumnDef`s; quill-specific options go in `meta`: `align: 'left' | 'center' | 'right'` (header + cells) and `expand: true` (absorb leftover width).
- `fullWidth` needs exactly one column with `meta: { expand: true }` to decide which column stretches.
- Sorting is client-side and on by default — click header toggles asc → desc → off. Opt out per column with `enableSorting: false`.
-- Pagination is opt-in via `pageSize`; the component owns page state and resets to page 0 when `pageSize` changes.
+- Pagination is opt-in via `pageSize`; the component owns page state and resets to page 0 when `pageSize` changes. The pager is suppressed when the table has no rows — an empty table shows only its empty state, never a "0–0 of 0" pager.
- Custom empty state via the `empty` prop (ReactNode); default is a minimal "No results".
- Don't rebuild tables from `Table` primitives when the data is row/column shaped and needs sorting or pagination — that's what DataTable is for. Drop to the `Table` primitive only for fully custom layouts.
diff --git a/packages/quill/packages/components/src/data-table.stories.tsx b/packages/quill/packages/components/src/data-table.stories.tsx
index 054976386934..79290063f259 100644
--- a/packages/quill/packages/components/src/data-table.stories.tsx
+++ b/packages/quill/packages/components/src/data-table.stories.tsx
@@ -192,6 +192,20 @@ export const Empty: Story = {
),
}
+// Empty + paginated — the pager is suppressed when there are no rows, so only
+// the empty state shows (no "0–0 of 0" pager).
+export const EmptyPaginated: Story = {
+ render: () => (
+ <DataTable
+ columns={columns}
+ data={[]}
+ pageSize={10}
+ pageSizeOptions={[10, 25, 50]}
+ className="max-w-2xl rounded-md border border-[var(--border)]"
+ />
+ ),
+}
+
// Override the empty slot with app-specific copy and actions.
export const EmptyCustom: Story = {
render: () => (
diff --git a/packages/quill/packages/components/src/data-table.tsx b/packages/quill/packages/components/src/data-table.tsx
index ecd65940e9d7..f99abc0a2f68 100644
--- a/packages/quill/packages/components/src/data-table.tsx
+++ b/packages/quill/packages/components/src/data-table.tsx
@@ -293,7 +293,9 @@ function DataTable<TData, TValue>({
</Table>
)
- if (!paginated) {
+ // Nothing to paginate when the table is empty — the empty state already
+ // signals the absence of data, so a "0–0 of 0" pager is just noise.
+ if (!paginated || table.getFilteredRowModel().rows.length === 0) {
return tableElement
}