Fit columns to viewport
Prop fitColumns — engine behaviour, default false.
Guide
When to use it
You want the table to always fill its container with no horizontal scrollbar — dashboards, fixed-width cards.
How it works
Distributes the available width across the visible columns (utility columns keep their fixed size). It's a pure render overlay — it never mutates your column-sizing model.
Gotchas
- While on, it suppresses resize handles and turns off column virtualization (it owns widths).
- Mutually exclusive with horizontal scrolling and with
enableResponsive(use one strategy).
Live example

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}
fitColumns />
)
}
Overview
| Layer | enable* (engine, resolved in useBstTable) |
| Type | boolean |
| Default | false |
| Maps to | custom render measure — sizes visible columns to the scroll box (utility columns fixed) so there is no horizontal scroll; overflow-x:hidden + resizers suppressed while on. Pure render overlay via distributeFitWidths (no model mutation) |
| Status | ✅ done |
| Since | v0.20.0 |
| Settings sheet | Columns |
Fit-to-viewport layout — size columns to the container so there is no horizontal scroll. The data columns share the available width in proportion to their own sizes (utility columns stay fixed); manual column resizing is suppressed while this is on. Default: false.
Enable it
<BstTableMui
data={rows}
columns={columns}
fitColumns
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.
Behavior & interactions
- Conflicts with
enableColumnResizing—fitColumnssuppresses the resizers. - Conflicts with
enableResponsive— responsive hiding is a no-op underfitColumns.
Spec coverage
Spec codes (
A1,C2,X8, …) are Bst-Table's internal requirement IDs from the capability matrix;P0–P2mark the delivery phase. They are traceability tags, not part of the public API.
- G3 · Auto layout — ✅ built. fixed layout + total-size + fitColumns fit-to-viewport