Skip to main content

Row selection

Prop enableRowSelection — engine behaviour, default false.

Guide

When to use it

Let users select whole rows with checkboxes — for bulk actions (delete, export, assign) on the chosen records.

How it works

Renders a checkbox column (header select-all + per-row). Pair with showSelectionInfo for a selected-count chip and Clear.

Gotchas

  • This is row selection (checkboxes), separate from cell/range selection (enableCellSelection) — you can run both.
  • Selection targets rows by id, so pass getRowId.

Live example

Row selection — checkboxes with a selected-count chip

Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra', team: 'Platform', role: 'Architect', score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
export default function App() {
return (
<BstTableMui data={seed} columns={columns} getRowId={(r) => r.id}
enableRowSelection showSelectionInfo
initialState={{ rowSelection: { '1': true, '3': true } }} />
)
}
Loading live example…

Overview

Layerenable* (engine, resolved in useBstTable)
Typeboolean
Defaultfalse
Maps tov9 enableRowSelection
Status✅ done (Phase 3)
Sincev0.5.0
Settings sheetSelection & clipboard

Row selection — a leading checkbox column with header "select all" (indeterminate when partial) and per-row checkboxes. Maps to v9 enableRowSelection; state lives in table.state.rowSelection, keyed by getRowId. Read it via table.getSelectedRowModel. Default: false (opt-in).

Enable it

<BstTableMui
data={rows}
columns={columns}
enableRowSelection
/>

Swap BstTableMui for BstTableShadcn (and the CSS import) for the shadcn skin — same props.

Options

OptionNotes
getRowIdselection state is keyed by row id; without it selection breaks on re-sort

Behavior & interactions

  • Read the selection with table.getSelectedRowModel().