Cell Validation

material-table-core supports cell validation during edit.

FieldType
column.validatefuncThe function to validate the current cell

Following returns are supported:#

Return valueType
booleanrowData => booleanReturn a Boolean to block save and show a red bar below that field (true for valid input)
stringrowData => stringReturn a string to block save, to show a red bar below that field and show an appropriate error message
objectrowData => { isValid: boolean; helperText: string }Return an object to optional block save and show a red bar below that field. A helper text will also be displayed, in red if isValid is false
info

If a string is return from validate (even ""), it will be interpreted as an error and will block the submit

Examples#

Live Editor
Result