TextWithImage block renders a two-column split: a Portable Text content area on one side and an image on the other. The imagePosition field controls which side the image appears on. LQIP (low-quality image placeholders) are supported for smooth lazy-loading.
Props
Optional heading above the body copy, rendered as
<h2> at 3xl–4xl with tight tracking.Portable Text body copy rendered with the project’s shared
portableTextComponents. Styled as prose with text-muted-foreground.Sanity image with hotspot enabled. Cropped to
800×600 (4:3 aspect ratio). The alt field on the image object is required for accessibility.Controls which side the image occupies. Defaults to
right. When set to left, the image uses @lg:order-first to prepend it in the column order.Background colour token. Defaults to
white.Vertical padding override. Defaults to
default.Content container max-width. Defaults to
default.Additional CSS classes.
HTML
id for anchor targeting.Usage in Sanity Studio
- Add a Text with Image block to a page.
- Set an optional Heading.
- Write the Content body copy using the Portable Text editor.
- Upload an Image and fill in the required Alternative Text field.
- Expand Layout Options and set Image Position to
leftorright(defaultright).
Variants / Options
Novariant field. The two layout options are:
imagePosition | Behaviour |
|---|---|
right (default) | Text left, image right |
left | Image left (via @lg:order-first), text right |