Skip to main content

Formats

format supports number, currency, percent, date, and image. It uses the Grid locale for number, currency, percent, and date; the numeric formats apply only to number values, and currency requires currency. date accepts Date values and valid date strings. A YYYY-MM-DD string is treated as a local calendar date, avoiding timezone shifts.

image is also a current declarative format:

{
type: 'image';
width?: number;
height?: number;
fit?: 'cover' | 'contain';
borderRadius?: number;
}

Its cell value is expected to be a URL string. null, undefined, and empty values render —. width, height, fit, and borderRadius control the thumbnail. As with every declarative format, renderCell has priority over format.

Try it live in the Lab