Element Reference

Image Element

1. Shape

interface ImageClip extends BaseClip {
  type: "image";
  src: string | { $ref: string };
}

2. Supported fields

src

  • Type: string | { $ref: string }
  • Required: yes
  • Purpose: image URL or image asset reference

3. Current runtime behavior

  • src supports direct URLs
  • src supports $ref
  • transform works
  • style.borderRadius works
  • style.objectFit works
  • style.filters works

4. style.objectFit

Supported values:

  • fill
  • cover
  • contain

Meaning:

  • fill: force-stretch to the target box and may distort
  • cover: keep aspect ratio and may crop
  • contain: keep aspect ratio and may leave empty space

Example:

{
  "style": {
    "objectFit": "cover"
  }
}

It can also be combined with filters:

{
  "style": {
    "objectFit": "cover",
    "filters": [
      { "type": "blur", "value": 24 }
    ]
  }
}

5. Example

{
  "type": "image",
  "start": 0.5,
  "duration": 4,
  "src": { "$ref": "logo" },
  "transform": {
    "x": "85%",
    "y": "10%",
    "width": 220,
    "height": 80
  },
  "style": {
    "borderRadius": 16,
    "objectFit": "contain"
  },
  "animations": [
    {
      "type": "fadeIn",
      "duration": 0.5
    }
  ]
}