Edit Mode
Preview

Inline text, select, and markdown editors for DataTable cells.

Overview

Inline edit mode turns DataTable into an editable grid. Pass a stable getRowId, mark editable cells with meta.editable, and write committed values back through inlineEdit.onCellCommit.

Only editable cells participate in inline edit mode. Text is the default editor. Use getEditor only when a column should switch to select or markdown.

Text Cells

Text is the default editor for short string fields like emails, roles, or locations.

Select Cells

Use select editors when a cell should commit one value from a fixed set. selectProps.style controls whether the selected value renders as plain text or as a badge.

Option Shape

options is an array of objects. value is the committed cell value, while label is the text shown in the trigger and menu.

const statusOptions = [
  {
    value: "Active",
    label: "Active",
    badgeProps: { variant: "success" },
  },
  {
    value: "Inactive",
    label: "Inactive",
    badgeProps: { variant: "destructive" },
  },
];
FieldTypeDescription
valuestringStored value committed back through onCellCommit
labelstringDisplay label shown in the select UI
disabledbooleanPrevent this option from being selected
badgePropsDataTableInlineEditSelectBadgePropsPer-option badge styling when selectProps.style is "badge"

selectProps.badgeProps sets default badge styling for the whole editor. option.badgeProps overrides that default for a specific option.

Markdown Cells

Use markdown editors for longer notes, annotations, or tokenized references. markdownProps.tokens lets you resolve inline tokens like §{clause-4.2}§ inside the cell.

Inline Tokens

Tokens let markdown cells turn inline references into richer interactive chips. Write the markdown value using the §{ref}§ syntax, then pass a matching InlineTokenMap through markdownProps.tokens.

const noteTokens: InlineTokenMap = {
  "clause-4.2": {
    variant: "citation",
    label: "§4.2(b)",
    popover: {
      snippet: "The indemnifying party shall hold harmless...",
      sourceFileName: "Contract_v3.pdf",
      sourceMimeType: "application/pdf",
    },
  },
  "nda-final": {
    variant: "file",
    label: "NDA_Final.docx",
    popover: {
      fileName: "NDA_Final.docx",
      mimeType:
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      fileSize: "2.4 MB",
      uploadedAt: "2026-03-08",
    },
  },
  "risk-score": {
    variant: "custom",
    label: "High Risk",
    triggerRender: () => <Badge variant="warning">High Risk</Badge>,
    popoverRender: () => <RiskSummary />,
  },
};

Each token entry uses the token ref as the object key. All variants share:

FieldTypeDescription
labelstringFallback label used by the built-in token trigger
onClick() => voidOptional click action owned by your app

Variant-specific fields:

VariantExtra FieldsDescription
citationpopover.snippet, popover.sourceFileName, popover.sourceMimeTypeRenders the built-in citation chip and document preview popover
filepopover.fileName, popover.mimeType, optional fileSize, uploadedAtRenders the built-in file chip and file metadata popover
customoptional triggerRender, popoverRenderLets you replace the trigger content, popover body, or both

If a markdown value contains §{ref}§ and that ref is missing from markdownProps.tokens, the cell leaves it as the literal token text rather than rendering a broken chip.

Commit Flow

DataTable owns the temporary editing UI, but your app owns persistence. onCellCommit fires when a value is committed by blur or Enter. Use getValue and parseValue when the displayed string and stored value differ.

inlineEdit={{
  getValue: (cell) => String(cell.getValue() ?? ""),
  parseValue: (raw) => raw.trim(),
  onCellCommit: ({ rowId, columnId, value }) => {
    saveCell(rowId, columnId, value);
  },
}}

API Reference

DataTable.inlineEdit

FieldTypeDescription
onCellCommit(args: DataTableInlineEditCommit<TData>) => voidCalled when an edit is committed
isCellEditable(cell: Cell<TData, unknown>) => booleanOverride the default meta.editable check
getValue(cell: Cell<TData, unknown>) => stringResolve the displayed string value
parseValue(raw: string, cell: Cell<TData, unknown>) => unknownTransform the input string before commit
getEditor(cell: Cell<TData, unknown>) => DataTableInlineEditEditorChoose the editor for a cell

Editor Types

EditorFieldsDescription
textinputPropsInline text editor. This is the default
selectoptions, selectPropsInline select editor with text or badge display
markdownmarkdownPropsInline markdown editor with optional token rendering

On this page