[]previous and next page

preloadImageTag

A head <link rel="preload"> for a priority image, with the same candidates, so the browser starts the download before the markup is parsed.

A head <link rel="preload"> for a priority image, with the same candidates, so the browser starts the download before the markup is parsed. Register it with useHead or put it in document.head.

Import#

ts
import { preloadImageTag } from "@shadow-js/dusk";

Signature#

ts
function preloadImageTag(options: ImagePropsOptions): HeadTag

Parameters#

Name Description
options The same options as imageProps.

Returns#

A head tag.

Examples#

ts
import { preloadImageTag } from "@shadow-js/dusk";
preloadImageTag({ src: "/hero.jpg", width: 1200, height: 630, alt: "" }).props.fetchpriority; // "high"