Migration Guide: API naming (v4.0.2)
Simple Table v4.0.2 introduces clearer public names that match how people talk about tables (columns, not “headers”; enable flags instead of should*/use* prefixes). Old names still work as aliases — update when convenient.
Compatibility
- Non-breaking. Preferred names are aliases. Existing
defaultHeaders,HeaderObject, and the other legacy names continue to work. - When both old and new props are passed, the preferred name wins (e.g.
columnsoverdefaultHeaders). - Docs and examples now use only the preferred names. See the changelog for the 4.0.2 entry.
Rename list
| Old name | Preferred name | Notes |
|---|---|---|
HeaderObject | ColumnDef | Core type alias; both names remain valid at runtime/types. |
ReactHeaderObject | ReactColumnDef | — |
VueHeaderObject | VueColumnDef | — |
AngularHeaderObject | AngularColumnDef | — |
SolidHeaderObject | SolidColumnDef | — |
SvelteHeaderObject | SvelteColumnDef | — |
defaultHeaders | columns | Vue: :default-headers → :columns |
editColumns | enableColumnEditor | — |
editColumnsInitOpen | enableColumnEditorInitOpen | — |
shouldPaginate | enablePagination | — |
onGridReady | onTableReady | — |
useHoverRowBackground | hoverRowBackground | — |
useOddColumnBackground | oddColumnBackground | — |
useOddEvenRowBackground | oddEvenRowBackground | — |
isEditable | editable | Column-level flag |
isSortable | sortable | Column-level flag |
isEssential | essential | Column-level flag |
Before / after
Before
React TSX
1import { SimpleTable } from "@simple-table/react";2import type { ReactHeaderObject } from "@simple-table/react";34const headers: ReactHeaderObject[] = [5 { accessor: "name", label: "Name", width: "1fr", isSortable: true, isEditable: true },6];78<SimpleTable9 defaultHeaders={headers}10 rows={rows}11 editColumns12 shouldPaginate13 onGridReady={() => {}}14 useHoverRowBackground15/>
After
React TSX
1import { SimpleTable } from "@simple-table/react";2import type { ReactColumnDef } from "@simple-table/react";34const columns: ReactColumnDef[] = [5 { accessor: "name", label: "Name", width: "1fr", sortable: true, editable: true },6];78<SimpleTable9 columns={columns}10 rows={rows}11 enableColumnEditor12 enablePagination13 onTableReady={() => {}}14 hoverRowBackground15/>
Suggested migration steps
- Upgrade to
4.0.2(or later). Your app should keep working with no changes. - Find/replace using the table above — start with
defaultHeaders→columnsand framework*HeaderObjecttypes →*ColumnDef. - Replace column flags
isSortable/isEditable/isEssentialwithsortable/editable/essential. Do not renameisSelectionColumn. - Run your typecheck — preferred names are fully typed on all adapters.
Next: Quick start · API reference · Changelog