Show, hide, reorder and pin table columns: a hidden column folds into a ball and drops into the tray, pinned ones slide up to the rail.
Click meTap me
Invoices
Invoices
#2047
Scale
Overdue
Oct 2
€4,820.00
#2045
Starter
Overdue
Oct 8
€290.00
#2044
Team
Pending
Oct 11
€1,860.00
#2043
Scale
Overdue
Oct 14
€3,075.00
#2041
Team
Pending
Oct 20
€1,240.00
#2040
Scale
Overdue
Oct 23
€5,210.00
column-manager · , lively
column-manager-demo.tsx
When to use
Use it next to any table people customise. It keeps pinned, visible and hidden columns in one list, works by pointer, touch or keyboard, and writes every change at once so the table reflows.
When not to use
For a plain visibility checklist the data table's own columns menu in Data Table is enough. To save a whole layout under a name use Saved Views.
Use it next to any table people tailor to their work: an invoices list, a stock list, a ticket queue, a report builder. Columns are objects you move, in three zones of one list: the Pinned rail at the top, the Visible pills, and the Hidden tray at the bottom. Hide, show, pin and reorder, by pointer, touch or keyboard. Every change is written at once, so the table reflows under the open panel. For a plain visibility checklist the data table's own DataTable.ColumnsMenu is enough; to save a whole layout under a name, pair it with saved views.
The motion follows the three beats. Pressing the eye ball charges: it stretches under the finger. On release it acts: the pill's label fades, its body narrows toward its leading edge into a 20 px ball, and the ball is thrown down the list into the tray while the list closes the gap. It settles with a squash against the tray's floor. A tray ball hops out, flies back to the slot it left and stretches into its pill again. A pin slides the pill up to the rail, whose rim tints primary, and the pill sinks once as it lands. Dragging a pill leans it 2° in the hand while its neighbours make room on one spring. calm keeps the fold and the throw but drops the lean and the squash; playful lets the throw land harder. The look never changes.
The value is { order, hidden, pinned: { left, right } }. order lists every column, hidden ones included, so a column shown again returns to the slot it left. toTableState(value) returns TanStack's { columnOrder, columnVisibility, columnPinning }; fromTable(table) reads them back; visibleColumnIds(value) gives the visible ids in display order for a table without a pinning feature (pick and sort your column definitions with it). The component does not depend on the data table, so it serves custom tables too.
required columns have no eye and no grip and sit pinned first. canPin: false removes a column's pin ball. pinSides="both" makes the pin ball cycle left, right, off. "Reset to default" returns to defaultValue (or the columns as given) and calls onReset. The value is controlled (value + onValueChange) or uncontrolled (defaultValue); onValueChange fires on every step of a drag. open / defaultOpen / onOpenChange control the panel; focusOnOpen={false} keeps focus where it is when the page opens the panel on its own.
Pick a layout with preset: popover (default: a "Columns · 5 of 7" trigger that morphs into a 280 px panel), sheet (the list for a drawer, zones as collapsible sections, for tables with 20 or more columns) or inline (the list flat in a settings card, no trigger). Set the character app-wide with MotionKitProvider, or per manager with temperament. On the trigger, your onClick, onKeyDown and onPointerDown still fire, and ref points at it.
The sheet preset inside a side drawer: twenty columns, three pinned, six in the tray. Each zone header folds its section; the list scrolls inside the drawer and a drag near its edge scrolls it.
The inline preset in a settings card with pinSides="both": the SLA column is pinned right, the ticket number and priority left. Save and Discard sit under the list.
Click meTap me
Default columns
What new agents see in the ticket queue. They can change their own view.
Arrow keys move between columns. Space grabs a column to move it. H hides or shows, P pins.
The trigger is a Radix Popover trigger (aria-haspopup="dialog", aria-expanded); its name includes the count ("Columns 5 of 7"). The panel has role="dialog", named by its title.
The list is a group named "Manage columns", with instructions as its description. Each pill is one tab stop (roving focus) described by its zone ("Pinned", "Visible", "Hidden"); the eye and pin balls are real buttons (aria-pressed, "Hide Amount", "Pin Amount") reached by pointer or by the H and P keys, so the list stays one stop in the tab order.
A polite live region announces every change: "Amount hidden. 6 of 7 visible", "Amount pinned left", "Amount, grabbed. Use arrows to move", "Amount, dropped at position 3 of 5".
The balls are 20 px with a 24 px hit area (WCAG 2.5.8). The grip, lock and icons, and the flying copy of a pill, are aria-hidden; tray balls carry the column's name as their label and tooltip.
Text is foreground and muted-foreground on background / muted, AA in both themes; the pinned pin ball is primary-foreground on primary. Focus rings are ring-[3px] ring-ring/50 on every control.
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") nothing folds, flies, hops, leans or squashes. A hidden column crossfades into its tray ball in place, a shown one back into its pill; the list and the panel's height reflow in the fade time, and the panel fades in next to the trigger. Every state is the same picture as the animated version's last frame: rims, the tinted rail, the muted tray.
The fold and the throw animate one absolutely placed copy of the pill: its transform, width and height (the layout exception for one small element, so the 1 px rim stays 1 px and the label is clipped, never squeezed). Pills reflow with Motion layout animations (transform); the list's height follows its content on the same spring.
Positions are read once per change (layout offsets, never inside a frame loop). Nothing runs at rest; the panel's content mounts only while open.
Third-party dependencies, measured apart: motion (layout, drag and Reorder) and @radix-ui/react-popover through the popover, shared with the combobox and the date picker.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.7 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
Dependencies
@radix-ui/react-popover
motion · peer
Triggers
click, drag, press, a value change
Reduced motion
No fold, throw, hop, lean or squash: a hidden column crossfades into its tray ball in place, the list reflows in the fade time, and the panel fades in next to the trigger.
Keyboard
Enter / Space on the trigger
Opens the panel; focus moves to the first column
ArrowUp / ArrowDown
Moves focus between the column buttons of the group (one Tab stop, roving focus), from the pinned rail through the visible pills to the hidden tray
Home / End
First / last column
Space / Enter on a pill
Grabs the column; Space or Enter again drops it
ArrowUp / ArrowDown while grabbed
Moves the column one slot within its zone (Home / End: to the zone's start or end)
Escape while grabbed
Drops the column where it is; the panel stays open
H
Hides the column (into the tray) or shows a tray column again
P
Pins or unpins the column (with pinSides both: left, right, off)
Enter / Space on a tray ball
Shows the column again in its last slot
Escape
Closes the panel; focus returns to the trigger
Tab
Leaves the list (drops a grabbed column)
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)