Skip to content

ImageProp

Image property definition for a prop a consumer fills with an image — a registry reference or an external source.

Path

component-api:props.<prop>

Members

MemberTypeRequiredDescription
type'image'YesThe discriminator — always 'image'.
defaultstring · nullNoDefault image — an images registry reference, or null.
nullablebooleanNoWhether this prop accepts a null value.
examplesImageValue[]NoAuthoring-default example images for this prop — the image the component was authored with.
$extensionsPropExtensionsNoPlatform provenance under reverse-domain keys.

Example

type: image
default: "#/images/avatarPlaceholder"
nullable: true

Where an authoring default lives

An authoring-default image sits in one of two places, and they describe different things:

LocationDescribes
ImageBinding.examplesThe image at that binding site — how one consumer placed it
ImageProp.examplesThe image the component itself was authored with

Where both apply to one rendered instance, the binding is the more specific statement. A designated image component is the origin of an image rather than a consumer of one, so it has no binding site in its own spec — examples on the prop is its only home for this.

examples is non-contractual reference material, parallel to StringProp.examples, and is distinct from default: a default states what the prop resolves to when a consumer omits it, while examples only demonstrate typical content.

props:
imageSource:
type: image
examples:
- $image: "#/components/dsImage/images/dsImage__image"

Platform bindings

Figma

Disposition: bound · Realised by: code-only container layer named in figma.images.sourceProps“

Rules: codeOnlyProps

An image prop has no native Figma property type; it is read from a code-only layer (ADR-063) and carries authoring-default images in examples (ADR-088). Render mints the hidden layer back.

CSS

Disposition: unsupported · Realised by: —

An image prop is content; the backgroundImage style key is the styling surface, and a bound image reaches it as a custom property the emitting platform writes.

React

Disposition: bound · Realised by: a nullable string URL member of the Props interface

An image registry pointer resolves to a served asset URL at emit. A bound prop carrying an authoring-default example (ADR-088) emits the example as the fallback — p.src ?? "<url>" — because composed content is static and without it the child falls back to its own default artwork.

Web Components

Disposition: bound · Realised by: a URL-valued property

Registry pointers resolve to served asset URLs under the emitted assets base, from the registry entry’s own src — an entry without one is unresolved and nothing further is tried (ADR-063).

Decisions

  • ADR-015 — Resolve AnyProp oneOf schema violation between TextProp and IconProp
  • ADR-019 — Allow null in StringProp.default
  • ADR-063 — Image content — backgroundImage fill, an images registry, ImageProp, and ImageBinding
  • ADR-088 — Authoring-default images on ImageProp
  • ADR-105 — Type–Schema Parity for Overlapping Prop Unions
  • ADR-125 — Instance-example orientation

Rules

RuleStatement
DSPEC-12null is meaningful only under a nullable prop

Source

FormatFile
JSON Schemapackages/schema/schema/component.schema.json
TypeScriptpackages/schema/types/Image.ts
Specification§4.2, §11