[]previous and next page

ImagePropsOptions

Options of imageProps.

Options of imageProps.

Import#

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

Signature#

ts
interface ImagePropsOptions {
  /** A path on this origin (`/images/a.jpg`) or an http(s) URL. */
  readonly src: string;
  /** The width the image is displayed at, in CSS pixels. */
  readonly width: number;
  /** The height it is displayed at, in CSS pixels; with `width` it reserves the box. */
  readonly height: number;
  /** Alternative text. Required: an empty string marks the image decorative. */
  readonly alt: string;
  /** The `sizes` attribute. Default: the display width in pixels. */
  readonly sizes?: string;
  /** Load now, not when the image nears the viewport, with a high fetch priority (the largest image of a page). */
  readonly priority?: boolean;
  /** Quality, 1 to 100 (values above 100 are 100). Default 75. */
  readonly quality?: number;
  /** Output format for the default optimizer URL. Default: the source's own. */
  readonly format?: ImageFormat;
  /** Builds the candidate URLs. Default: the optimizer endpoint. */
  readonly loader?: ImageLoader;
}

Members#

Name Type Description
src readonly src: string A path on this origin (/images/a.jpg) or an http(s) URL.
width readonly width: number The width the image is displayed at, in CSS pixels.
height readonly height: number The height it is displayed at, in CSS pixels; with width it reserves the box.
alt readonly alt: string Alternative text. Required: an empty string marks the image decorative.
sizes? readonly sizes?: string The sizes attribute. Default: the display width in pixels.
priority? readonly priority?: boolean Load now, not when the image nears the viewport, with a high fetch priority (the largest image of a page).
quality? readonly quality?: number Quality, 1 to 100 (values above 100 are 100). Default 75.
format? readonly format?: ImageFormat Output format for the default optimizer URL. Default: the source's own.
loader? readonly loader?: ImageLoader Builds the candidate URLs. Default: the optimizer endpoint.