Components/Data Table

Data Table

One component, 724 by 369, and no variant axis anywhere. The only page in the kit that publishes a finished thing rather than a set of switches.

Data Table · Components frameLive in the browser · drawn to match the file
Dataset
tick rows, type in the filter, open Columns or a row's dots
Status
Email
Amount
Success
michael.mitc@example.com
$630.44
Success
felicia.reid@example.com
$767.50
Processing
georgia.young@example.com
$396.84
Success
alma.lawson@example.com
$475.22
Failed
dolores.chambers@example.com
$275.43
0 of 5 row(s) selected.
Dataset=Payments724 × 369 in the file
One component, no axes

A finished table rather than a kit of parts

Data Table is the only page in the kit that publishes a single component with no variant axis at all. There is nothing to switch: you drop in one 724 by 369 table and edit the rows. A table's variability is in its data and its columns, and neither of those is something a variant dropdown can hold.

PartSizeDetail
Header724 × 6416 above and below, filter left, Columns right
Head Row724 × 40labels at weight 500, a sort arrow on the wide column
Row 1 to 5724 × 4140 of content plus its own 1px rule at the foot
Cells32 · 118 · 431 · 99 · 448px side padding, 6px gap; amount is right aligned
Footer724 × 60selection count left, Previous and Next right at radius 8
what is borrowed and what is local

The filter field is a real Input instance, the Columns button a real Button, and every checkbox a real Checkbox. The rows and cells are local boards rather than instances of the Table component, so column widths stay editable without detaching anything. Change base.border once and the rules, the field and the buttons all move together.

the two controls a static file cannot open

shadcn/ui hangs a dropdown off both the Columns button and each row's dots: a checkbox list of hideable columns on one, and Copy payment ID, a rule, then View customer and View payment details on the other. The Penpot file draws both at rest, which is all a design file can do, so they are wired up in the preview above. Hide a column and the wide one absorbs the space, keeping the table at 724.

two ticks that were only half drawn

In the Invoices example the two selected rows had their checkbox painted base.primary but with no tick inside: the instance had been recoloured rather than switched to the Checked variant, so it read as a solid dark square. Both are now the real checked Checkbox, and the table's size is unchanged.

The usage frame

The same table twice, with different data

852 by 1101, holding two copies. Payments has nothing selected and the filter still showing its placeholder; Invoices has a query typed in, two rows picked and the footer counting them. Both are the same component, which is the point being made. Switch between them at the top of this page.

filter empty · 0 of 5 selected
Successmichael.mitc@example.com$630.44
Successfelicia.reid@example.com$767.50
Processinggeorgia.young@example.com$396.84
Successalma.lawson@example.com$475.22
Faileddolores.chambers@example.com$275.43
filter typed · 2 of 5 selected
PaidINV-2412 · Northwind Ltd$1,240.00
PaidINV-2413 · Acme Corp$860.00
PendingINV-2414 · Globex$2,310.50
OverdueINV-2415 · Initech$430.75
PendingINV-2416 · Umbrella$1,095.20
In the file

One component, no variants

Read straight out of the Penpot file. The axes below are the property names you will see in the variant dropdown.

Data Tablenonea header, five rows and a footer at 724 × 3691
Columnsfixed widths32 · 118 · 431 · 99 · 44, adding to 7245
Borrowed componentsinstancesInput for the filter, Button for Columns and the pager, Checkbox on every row3

Using the Data Table

Because what varies in a table is its data and its columns, and neither fits in a variant dropdown. Drawing Rows: 5 · 10 · 20 as an axis would triple the file for no gain, since you edit the rows either way. It is the one component here published as a finished thing.

No, the rows and cells are local boards. Table is published separately with its own cell variants, but a data table needs column widths you can drag, and a local board lets you do that without detaching. What is borrowed is everything interactive: the filter is an Input, the Columns and pager buttons are Buttons, and every checkbox is a Checkbox.

The extra pixel is the rule. Every body row carries its own 1px base.border along the bottom rather than the table drawing dividers between them, so deleting a row takes its rule with it and nothing has to be tidied up afterwards.

A 44px cell holding Tabler's horizontal dots, the row action menu. It is centred on body rows and empty in the head, which is why that one cell is the only place where the head row and the body rows do not line up their alignment.

Data display · 0 variants