This guide covers changes to the beta DataTable component. These APIs may continue to evolve before the stable release.
Overview
The DataTable column helper now supports two new properties that improve developer experience:type- Automatically configures display formatting and alignment based on data typeeditConfig- Consolidates cell editing configuration into a single, explicit opt-in property
Design Rationale
Why type?
Previously, configuring a currency column required setting multiple independent properties:
type property captures this relationship:
Why editConfig?
The previous API scattered edit-related properties across the column definition:
editConfig property makes the intent explicit:
editConfig, columns are read-only regardless of type.
Extensibility
This structure supports new functionality without returning to scattered top-level edit props:- New column types (e.g.,
link,avatar,progress) can be added with appropriate defaults - Shipped edit modes already share one configuration surface:
text,number,boolean,select,multiselect, andcustom - Mode-specific options (like
minValue,maxValue, andstepfor number mode, orrenderEditorfor custom mode) live directly insideeditConfig
Column Types Reference
Each type sets default values foralign and renderCell:
| Type | Default Align | Default Formatter |
|---|---|---|
text | start | None (raw value) |
number | end | numberFormatter |
currency | end | currencyFormatter |
percent | end | percentFormatter |
date | end | dateFormatter |
dateTime | end | dateTimeFormatter |
time | end | timeFormatter |
boolean | start | booleanFormatter |
Using Type with Custom Options
For simple cases, pass the type as a string:Overriding Type Defaults
Explicit properties always override type defaults:EditConfig Reference
TheeditConfig property accepts an object with mode, onChange, and mode-specific options. Today that includes text, number, boolean, select, multiselect, and custom.
Text Mode
Select Mode
Multiselect Mode
Custom Mode
Custom mode is for object-backed cells whose read view and edit view are intentionally different. It addsrenderEditor for the custom editor surface, while renderCell and getReadRenderResult continue to define the read path. renderEditor now receives a typed controller for draft mutation, validation, focus management, and explicit close requests.
Migration Guide
Display-Only Columns
No changes required. Optionally addtype for automatic formatting:
Editable Columns
MoveeditMode, onChange, and options into editConfig. Custom editing is also configured only through editConfig; there is no legacy top-level custom API:
Deprecation Timeline
The following props show deprecation warnings in development:editMode- UseeditConfig.modeinsteadonChange(top-level) - UseeditConfig.onChangeinsteadoptions(top-level) - UseeditConfig.optionsinstead
@deprecated JSDoc comments.
New Exports
The following types are now exported from@servicetitan/anvil2:
ColumnType- Union of column type literalsColumnTypeConfig- Type configuration (string or object with options)EditConfig,TextEditConfig,SelectEditConfig,MultiselectEditConfig- Edit configuration typesgetColumnTypeDefaults(),resolveColumnTypeConfig()- Utility functions for working with column types