ISrcObject

interface
Data Shapes

Structured image source descriptor for <OrigamImg>. Allows passing src, srcset, lazySrc, aspectRatio and alt as a single object to the src prop instead of individual attributes.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

src
string
The primary image URL.
srcset
string
Responsive srcset string for the image.
lazySrc
string
Low-quality placeholder image URL shown while the main src loads.
aspectRatio
required
number
Intrinsic aspect ratio (width / height). Required to reserve layout space before the image loads.
alt
string
Alt text for the image. Forwarded to the underlying <img> element.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Passing an ISrcObject to OrigamImg

typescript