remold/ui

Bulk selection

Selecting many rows at once: shift-click selects a range, neighbouring picks join into one band, and the hint at the foot gives way to an action bar whose count rolls as the selection grows.

TanStack TableBase UIMotion

Files 6SizeEdited

⇧ Shift-click to select a range

Things to try

  • Tick a row, then shift-click another. Everything between is selected, and neighbouring picks join into one band.
  • Watch the header box. It shows when some or all of the rows are selected.
  • Look at the foot. The hint gives way to an action bar whose count rolls as the selection grows.
  • Delete. The chosen rows fold away one after another, and the bar offers Undo.

Install

npx shadcn@latest add https://your-docs-site/r/bulk-select.json

Dependencies

The install command adds these for you. If you copy the code by hand, install them yourself.

npm install @base-ui/react @hugeicons/core-free-icons @hugeicons/react @remold-ui/react @tanstack/react-table motion

How it works

  • TanStack Table models it. useReactTable holds the columns, the row model and row selection, so select-all, the header's mixed state and each row's checkbox read from one selection. Swap in your own data and columns and the rest keeps working.
  • Base UI draws the controls. The checkboxes are Base UI's Checkbox, and the action bar's buttons have Base UI tooltips.
  • Motion moves it. The joined bands, the rolling count and the rows folding away are Motion.
The files are made up.

On this page