Skip to main content
WireKit
Copy for LLM

Image

<x-wirekit::image> renders a user-content image as a semantic <figure> with required alt text, native lazy loading, and an optional caption. Set a ratio and it reserves the space before the image loads, so the page never shifts as images arrive (CLS-safe). The component only renders — pass a ready URL (a signed, ACL-protected download URL works unchanged).

For a profile picture use <x-wirekit::avatar>; for a before/after slider use <x-wirekit::image-compare>.

Usage

Content image with a caption
The team gathered at the 2026 offsite
The 2026 offsite

CLS-safe ratio box

Set ratio so the box is sized from the start and the layout never jumps. fit controls how the image fills the box — cover (fill + crop) or contain (letterbox):

Fixed 16/9, cover
A wide landscape

Square, contain

Square 1/1, contain
A product shot

Decorative image

An image that adds no information passes an empty alt so screen readers skip it. Only use this when the image is truly decorative:

Decorative image (empty alt)

Props

Prop Type Default Description
src string|null null Image URL (ready-to-render; signed URLs work).
alt string '' Accessible name. Required for content images; empty for decorative.
caption string|null null Optional visible caption, rendered as a <figcaption>.
ratio string|null null Intrinsic aspect-ratio (16/9, 4/3, 1/1, …) — reserves space before load.
fit string 'cover' cover (fill + crop) or contain (letterbox). Applies only with a ratio.
rounded bool false Round the corners with the --radius-wk-md token.
loading string 'lazy' Native loading — use eager for an above-the-fold hero.
scope string|null null Scoped personalization key.

Accessibility

  • alt is required for content images. Describe what the image shows. Pass alt="" only for a purely decorative image, so assistive tech skips it instead of announcing the file.
  • The image is wrapped in a <figure>; a caption renders as its <figcaption>.
  • With a ratio, the reserved box prevents layout shift, which also keeps focus order stable as images load.

Keyboard Interaction

This component is purely presentational and does not respond to keyboard input.

Was this page helpful?

Thanks — that helps.

Voting requires cookies or local storage. What we store