Skip to content
HomePagesHomePages template kit

image

A single image slot — the resolved value is always one `ImageValue`, never a list, so it carries no count bounds (a list of them does).

A single image slot — the resolved value is always one ImageValue, never a list, so it carries no count bounds (a list of them does). crop/frame drive the editor’s cropper and the renderer’s <Image> box; sourceFilter narrows the candidate pool the editor offers, routing the slot to a dedicated picker. fill takes an imageAssign, or a contactAssign naming one of a contact’s image fields — the alternative to source, never its companion.

Import from @homepages/template-kit.

function image<const HasSource extends SlotSource | ComputeBinding<unknown> | undefined = undefined>(opts: ImageOptions & { source?: HasSource; fill?: ImageFill; } & WritebackOption<HasSource> & FillOption<HasSource, ImageFill>): ImageSlotDef & SourceMark<HasSource> & FillMark<ImageFill>
Name Type Required Description
opts `ImageOptions & { source?: HasSource; fill?: ImageFill } &
WritebackOption<HasSource> & FillOption<HasSource, ImageFill>` | required | |

ImageSlotDef & SourceMark<HasSource> & FillMark<ImageFill>

import { image } from "@homepages/template-kit";
image({ label: "Floor plan", sourceFilter: "floorplans" });