Skip to content
// EFFECT DAYS 2026

HtmlImages unstable

The image loader, for loading an image the page doesn't show yet.

3 exports Since v4.2.0 Source

Models

ImageSource

interface unstable
Since v4.2.0

An image to load, as the <img> attributes of the same names.

Signature

interface ImageSource {
readonly crossOrigin?: "anonymous" | "use-credentials";
readonly referrerPolicy?: string;
readonly sizes?: string;
readonly src?: string;
readonly srcSet?: string;
}

References

Images

unstable
Since v4.2.0

The image loader. It defaults to one whose loads never settle.

Signature

declare const Images: Reference<Images>

Services

Images

interface unstable
Since v4.2.0

Loads images the page doesn't show, such as to show an <img> only once its source has loaded.

Details

load settles with "loaded" or "error", and interrupting it drops the load. BrowserHost.layer provides one that loads in a detached <img> of its document. The default never settles, so on a host without a document an image stays loading. A test settles loads with TestImages from effect/ui/html/testing.

Signature

interface Images {
readonly load: (source: ImageSource) => Effect<"error" | "loaded">;
}