sizes[*]

On this page

Description:

This key represents an individual size definition in the options.sizes array for Image Inputs.

The value is an object that can contain size and target properties.

Appears in:
└── sizes
    └── [*]
Type:
Object
Properties:
sizestring Required#

This key defines a number suffixed with "x" (relative size) or "w" (fixed width) for setting the dimensions of the image (e.g. 2x, 3x, 100w, 360w).

Appears in: sizes[*].

Show examplesHide examples

In this example, we have configured a size definition for an Image Input to create a 2x relative size image.

Copied to clipboard
_inputs:
  hero_image:
    type: image
    options:
      sizes:
        - size: 2x
{
  "_inputs": {
    "hero_image": {
      "type": "image",
      "options": {
        "sizes": [
          {
            "size": "2x"
          }
        ]
      }
    }
  }
}
targetstring#

This key defines a reference to another input that is given the path to this additional image file.

Appears in: sizes[*].

Examples:

In this example, we have configured a size definition for an Image Input.

Copied to clipboard
_inputs:
  hero_image:
    type: image
    options:
      sizes:
        - size: 2x
          target: hero_image_2x
{
  "_inputs": {
    "hero_image": {
      "type": "image",
      "options": {
        "sizes": [
          {
            "size": "2x",
            "target": "hero_image_2x"
          }
        ]
      }
    }
  }
}
Open in a new tab