Skip to content

Table: bulk row selection with leading checkbox column #171

Open

Description

@coloneljade

Problem

Tabular interfaces frequently need multi-row operations — delete selected rows, mark selected as active, export selected. The DataTable MVP (#161) has no built-in concept of row selection.

Impact

  • Consumers building bulk-action UIs wire their own selection state, header checkbox, indeterminate state, and aria-selected wiring. Drift across apps.
  • Selection accessibility is fiddly (aria-selected on rows, aria-checked on the leading checkbox, indeterminate state on the header checkbox, keyboard shortcuts for select-all and select-range).

Suggested Approach

Opt-in via props, with controlled selection state:

interface IDataTableProps<T> {
  selection?: {
    selectedKeys: Set<string>;  // values from rowKey(row)
    onSelectionChange: (selectedKeys: Set<string>) => void;
    mode?: 'single' | 'multiple';  // default: 'multiple'
  };
}
  • When selection is provided, a leading checkbox column is added to the table.
  • Header checkbox: checked when all visible rows are selected, indeterminate when some are selected, unchecked when none. Click toggles select-all / deselect-all (visible rows only — interacts with Table: row filtering #168 filtering).
  • Per-row checkbox: standard DataCheckbox with aria-labelledby referencing the row's row-header cell for context.
  • Keyboard:
    • Space toggles selection on the focused row
    • Shift+Click extends selection from the last-selected row to the clicked row
    • Shift+Arrow extends selection in arrow direction
    • Ctrl/Cmd+A selects all visible rows (focus must be inside the table)
  • aria-selected="true" on selected rows.
  • Selection survives sort, filter, and pagination via selectedKeys (parent owns the set).

Context

Layered on top of #161 (DataTable MVP). Composes with #167 (sort), #168 (filter), #169 (pagination). Selection state is independent of edit state.

Activity

  1. added this to the DataTable milestone on May 4, 2026
  2. added
    enhancement
    on May 4, 2026
  3. changed the title [-]DataTable: bulk row selection with leading checkbox column[/-] [+]Table: bulk row selection with leading checkbox column[/+] on May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions