This guide covers changes to the beta DataTable component. These APIs may continue to evolve before the stable release.
Overview
This guide continues the work started in Column Types and EditConfig, which introduced theeditConfig property. The boolean edit mode is a new addition that provides a purpose-built editing experience for boolean columns.
The DataTable now supports a dedicated boolean edit mode for inline editing of boolean cell values:
editConfig.mode: "boolean"- Renders a dropdown menu with predefined true/false options- Optional null support - Include a null option for nullable boolean columns
- Configurable labels - Customize the display text for
true,false, andnullvalues
Design Rationale
Why a dedicated boolean mode?
The text edit mode previously accepted boolean values by converting them to strings:- Values lost their boolean type, requiring manual parsing in
onChange - Users could type arbitrary text, not just “true” or “false”
- No constrained selection UX for a binary choice
Relationship between type and editConfig
The type property controls how a value is displayed when the cell is not being edited. The editConfig controls the editing behavior. These are independent concerns:
Label inheritance from type.options
When type is configured with BooleanFormatterOptions (i.e. { type: "boolean", options: { trueLabel, falseLabel } }), the boolean edit mode will automatically use those labels as defaults for the edit dropdown. This avoids duplicating labels across type.options and editConfig:
editConfig.trueLabel/editConfig.falseLabel(explicit override)type.options.trueLabel/type.options.falseLabel(inherited from formatter config)"True"/"False"(hardcoded defaults)
editConfig when you need different text for the edit dropdown than for the display formatter.
Boolean Edit Options Reference
Boolean-specific options are set directly on theeditConfig object alongside mode and onChange. All options are optional.
| Option | Type | Default | Description |
|---|---|---|---|
trueLabel | string | "True" | The label displayed for the true option |
falseLabel | string | "False" | The label displayed for the false option |
allowNull | boolean | false | Whether to include a null option in the dropdown |
nullLabel | string | "Unset" | The label displayed for the null option (when allowNull is true) |
Basic boolean editing
Custom labels
Nullable boolean with custom labels
Migration Guide
Boolean columns using text edit mode
If you were usingeditMode: "text" or editConfig.mode: "text" for boolean data, switch to boolean mode:
Boolean columns using editConfig text mode
Boolean columns using select edit mode
If you were usingmode: "select" to simulate boolean editing with manual options:
Breaking Changes
The following change is breaking:- Text edit mode no longer accepts
booleanvalues - Previously, a cell withmode: "text"and a boolean value would silently convert the boolean to a string. Now, the cell falls back to a read-only state and logs a console warning directing you to usemode: "boolean"instead.
Why breaking?
Since DataTable is a beta component, we opted to remove the implicit coercion rather than maintain a deprecation path. The coercion masked type mismatches and produced a suboptimal editing experience for boolean data. The new boolean edit mode is the correct replacement.New Exports
The following types are now exported from@servicetitan/anvil2:
BooleanEditConfig- Edit configuration type formode: "boolean"columns