Column Types in Apex Grid
Each column in the Apex grid declares a type that determines how it renders, how it sorts, and which editor it uses in inline-editing mode. Seven built-in types cover the common cases; for one-off display tweaks, use a cell template on the column.
Built-in types
| Type | Display | Editor | Notes |
|---|---|---|---|
string (default) | Plain text | Single-line input | |
number | Right-aligned, locale-formatted | Numeric input | |
boolean | Polished checkbox / dash glyph | Native checkbox | |
select | Label for the matched option | Dropdown of options[] | Provide options on the column |
rating | Star bar (filled / empty) | Star bar with keyboard support | Configurable max value |
date | Locale-formatted date | Native date picker | Accepts Date or ISO string |
image | Inline image preview | URL input | Falls back to alt text on load failure |
Declaring a column type
{
key: 'createdAt',
type: 'date',
}
For types that need configuration:
{
key: 'priority',
type: 'select',
options: [
{ value: 'low', label: 'Low' },
{ value: 'medium', label: 'Medium' },
{ value: 'high', label: 'High' },
],
}
{
key: 'score',
type: 'rating',
max: 5,
}
Customizing cell display
The seven built-in types are the only registered types. For column-specific display formatting (currency, status pills, icons, etc.), use the per-column cellTemplate — it receives the cell value and returns a Lit template rendered in the cell.