Skip to main content

image Field Type

type: 'image' renders an image URL as an <img> element. Use imageOptions to control dimensions, shape, fit, decorative styles, and lightbox behaviour.

Core Examples​

Basic Avatar​

Circular avatar alongside name and role in grid mode. Priya's null avatar is still rendered — use condition to suppress null values.

Avatar:
Avatar
Name:Aurora Chen
Role:Design Lead
Avatar:
Avatar
Name:Mateo Silva
Role:Platform Engineer
Avatar:
Avatar
Name:Priya Nair
Role:Operations
{
key: 'avatar',
label: 'Avatar',
type: 'image',
imageOptions: { width: 48, height: 48, circular: true },
}

Sizing, Shape, and Shadow​

width and height accept numbers (px) or any CSS length string. borderRadius rounds corners. shadow accepts any CSS box-shadow value.

Rectangular thumbnails with rounded corners and a drop shadow.

Name:Aurora Chen
Thumbnail:
Thumbnail
Name:Mateo Silva
Thumbnail:
Thumbnail
Name:Priya Nair
Thumbnail:
Thumbnail
{
key: 'thumbnail',
label: 'Thumbnail',
type: 'image',
imageOptions: {
width: 160,
height: 100,
objectFit: 'cover',
borderRadius: 8,
shadow: '0 2px 6px rgba(0,0,0,0.25)',
},
}

lightbox: true makes the image clickable — clicking opens a modal overlay with the full image. zoom: true enables zoom-on-hover inside the lightbox.

Small thumbnails in table mode. Click any image to open the lightbox modal.

Name
Role
Preview
Aurora ChenDesign Lead
Mateo SilvaPlatform Engineer
Priya NairOperations
{
key: 'thumbnail',
label: 'Preview',
type: 'image',
imageOptions: {
width: 64,
height: 40,
objectFit: 'cover',
borderRadius: 4,
lightbox: true,
zoom: true,
},
}

Condition​

Use condition to suppress the image field entirely for rows where the value is null or missing.

Avatar is hidden for Priya (null value). Aurora and Mateo show their circular avatars.

Avatar:
Avatar
Name:Aurora Chen
Role:Design Lead
Avatar:
Avatar
Name:Mateo Silva
Role:Platform Engineer
Name:Priya Nair
Role:Operations
{
key: 'avatar',
label: 'Avatar',
type: 'image',
imageOptions: { width: 48, height: 48, circular: true },
condition: (entity) => Boolean(entity.avatar),
}

Field Options Reference​

OptionTypeDefaultEffect
keystringrequiredEntity property to read the image URL from.
labelstringunsetColumn header or card label. Also used as alt text fallback.
type'image'—Renders the value as an <img> element.
condition(entity) => booleanunsetHides the field for rows where the function returns false.
formatter(value, entity) => unknownunsetTransforms the raw value before use as src.
imageOptionsobjectsee belowControls image dimensions, shape, fit, decoration, and behaviour.

imageOptions​

OptionTypeDefaultEffect
widthnumber or CSS string100Image width. Numbers are interpreted as px.
heightnumber or CSS string100Image height. Numbers are interpreted as px.
objectFit'cover', 'contain', 'fill', 'none', 'scale-down''cover'CSS object-fit — controls how the image fills its box.
circularbooleanfalseSets border-radius: 50%. Overrides borderRadius.
borderRadiusnumber or CSS string0Rounded corners. Numbers are interpreted as px. Ignored when circular: true.
borderCSS stringunsetCSS border shorthand (e.g. '2px solid #ccc').
shadowCSS stringunsetCSS box-shadow value.
backgroundColorCSS stringunsetBackground color — useful for transparent PNGs.
altstringlabel or keyAlt text for accessibility.
lazybooleantrueUses loading="lazy" for deferred loading.
lightboxbooleanfalseMakes the image clickable — opens a full-size modal overlay on click.
zoombooleanfalseEnables zoom-on-hover inside the lightbox. Requires lightbox: true.

Caveats​

  • wrap has no effect on image fields — the wrap logic in FieldRenderer explicitly skips type: 'image'.
  • Passing a null or empty value renders a broken <img> element. Use condition: (entity) => Boolean(entity.fieldKey) to suppress null rows.
  • formatter output is used as the src value — useful for constructing URLs from IDs or path fragments.
  • The lightbox modal is rendered inline in the DOM via ModalRenderer. It is not portalled — z-index layering in deeply nested layouts may require CSS overrides.

See Also​