---
title: "Mockup previews ajax | Customer&#x27;s Canvas Hub"
canonical: "https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/mockup-previews-ajax/"
archived: false
applies_to:
  - product: "Customer's Canvas Hub"
    versions: ["cloud"]
    entity_id: "https://customerscanvas.com/products/hub#software-application"
  - product: "Product Information Management (PIM)"
    versions: ["cloud"]
  - product: "UI Framework"
    versions: ["4.47 - 4.47"]
    entity_id: "https://customerscanvas.com/glossary/ui-framework#software-application"
---

# Mockup previews ajax

**Applies to:** Customer's Canvas Hub cloud; Product Information Management (PIM) cloud; UI Framework 4.47 - 4.47

> Generates previews from the mockups of a PIM product and exposes image URLs to other widgets.

This non-visual widget generates previews from the mockups of a product configured in the [PIM module](https://customerscanvas.com/docs/hub/admin-guide/pim.md). The resulting image URLs are available through the `urls` property and can be displayed with any widget that shows images, for example, [`slider`](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/slider.md).

Use `mockup-previews-ajax` with [`pim-ajax`](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/pim-ajax.md) instead of writing custom `ajax`-based configurations. For product previews, it is a more flexible alternative to [`preview-mockup-slider`](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/preview-mockup-slider.md). For release details, see [Release notes](https://customerscanvas.com/docs/hub/dev-center/release-notes.md#october-2026).

```json
{
  "name": "mockup-previews",
  "type": "mockup-previews-ajax",
  "params": { ... }
}
```

## Params

- `size`: The preview size, an object with `width` and `height`.
  - `width`: The preview width.
  - `height`: The preview height.
- `state`: The state information, an object with `id` and the optional `surfacesCount`.
  - `id`: The ID of the private state.
  - `surfacesCount`: _(Optional)_. The number of surfaces. If you specify it, the widget does not request design information.
- `mockups`: Mockup descriptions from [`pim-ajax`](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/pim-ajax.md).

## Properties

- `urls`: An array of preview image URLs.

## Examples

### Generating previews

The following example generates previews for the state returned by the [Data-Driven Editor](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/data-driven-editor.md) widget and for the mockups returned by `pim-ajax`. Here, `state.id` is the state ID returned by Data-Driven Editor.

```json
{
  "name": "mockup-previews",
  "type": "mockup-previews-ajax",
  "params": {
    "autoCompile": false,
    "size": {
      "width": 1200,
      "height": 1200
    },
    "state": {
      "id": "{{ $['dd-editor'].stateId }}"
    },
    "mockups": "{{ $['pim-ajax'].mockups }}"
  }
}
```

### Displaying previews

To display the previews, pass the `urls` property to any widget that shows images. The following example uses the [`slider`](https://customerscanvas.com/docs/hub/admin-guide/workflows/ui-framework/widgets/slider.md) widget.

```json
{
  "name": "preview",
  "type": "slider",
  "params": {
    "direction": "tile",
    "rows": 1,
    "columns": "{{ Math.min(2, $['mockup-previews'].urls.length) }}",
    "containerColor": "#eee",
    "images": {
      "{{#each $['mockup-previews'].urls as imageUrl }}": {
        "url": "{{ imageUrl }}"
      }
    }
  }
}
```
