---
title: "au-widget-mockup-previews | Customer&#x27;s Canvas"
canonical: "https://customerscanvas.com/docs/on-premises/ui-framework/widgets/reference/au-widget-mockup-previews/"
archived: false
applies_to:
  - product: "Customer's Canvas On-Premises"
    entity_id: "https://customerscanvas.com/glossary/customers-canvas-on-premises#software-application"
  - product: "Customer's Canvas Hub"
    versions: ["cloud"]
    entity_id: "https://customerscanvas.com/products/hub#software-application"
  - product: "UI Framework"
    versions: ["4.0 - 4.47"]
    entity_id: "https://customerscanvas.com/glossary/ui-framework#software-application"
---

# au-widget-mockup-previews

**Applies to:** Customer's Canvas On-Premises; Customer's Canvas Hub cloud; UI Framework 4.0 - 4.47

> API reference for the au-widget-mockup-previews module in UI Framework widgets.

## Classes

### AuWidgetMockupPreviewAJAX

A widget for get previews on mockups.

Example of use:
```json
{
  "widgets": [
    {
      "name": "mockup-previews",
      "type": "mockup-previews-ajax",
      "params": {
        "size": { "width": 450, "height": 450 },
        "visualizePrintAreas": false,
        "format": "png"
        "state": {
          "id": "{{ $['editor].stateId }}",
          "surfacesCount": "{{ $['editor'].surfaceCount }}"
        },
        "mockups": "{{ $['pim-ajax'].mockups }}"
      }
    }
}
```

#### Constructors

##### Constructor

```ts
new AuWidgetMockupPreviewAJAX(): AuWidgetMockupPreviewAJAX;
```

###### Returns

[`AuWidgetMockupPreviewAJAX`](#auwidgetmockuppreviewajax)

###### Overrides

```ts
AuBaseInvisibleWidget.constructor
```

#### Properties

##### params

```ts
params: any;
```

Compiled widget configuration.

###### Inherited from

```ts
AuBaseInvisibleWidget.params
```

##### urls

```ts
urls: string[] = [];
```

#### Accessors

##### surfacesCount

###### Get Signature

```ts
get surfacesCount(): any;
```

###### Returns

`any`

##### template

###### Get Signature

```ts
get static template(): any;
```

###### Returns

`any`

###### Inherited from

```ts
AuBaseInvisibleWidget.template
```

#### Methods

##### checkInitDependenciesWidgets()

```ts
checkInitDependenciesWidgets(): string[];
```

Returns an array of widget names, due to which the current widget cannot receive parameters.

###### Returns

`string`[]

###### Inherited from

```ts
AuBaseInvisibleWidget.checkInitDependenciesWidgets
```

##### render()

```ts
render(): Promise<void>;
```

###### Returns

`Promise`\<`void`\>

##### resetPreloaderState()

```ts
resetPreloaderState(): void;
```

###### Returns

`void`

###### Inherited from

```ts
AuBaseInvisibleWidget.resetPreloaderState
```

##### showPreloader()

```ts
showPreloader(
   isPreload, 
   message?, 
   timeout?): void;
```

Shows a preloader.

```
"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]
```

###### Parameters

| Parameter | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `isPreload` | `boolean` | `undefined` | If `true`, enables the preloader. |
| `message` | `string` \| `string`[] | `...` | A text message that appears next to the preloader. |
| `timeout` | `number` | `5` | - |

###### Returns

`void`

###### Inherited from

```ts
AuBaseInvisibleWidget.showPreloader
```

##### showToast()

```ts
showToast(data?, duration?): void;
```

Shows a toast.

```
return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });
```

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `data?` | `string` | A string message to display in the toast. |
| `duration?` | `number` | Defines how long to show the toast for. |

###### Returns

`void`

###### Inherited from

```ts
AuBaseInvisibleWidget.showToast
```

## Interfaces

### IMockupPreviewAJAX

#### Properties

##### format

```ts
format: "png" | "jpeg";
```

##### mockups

```ts
mockups: ProductInformationMockup[];
```

##### size

```ts
size: object;
```

###### height

```ts
height: number;
```

###### width

```ts
width: number;
```

##### state

```ts
state: object;
```

###### id

```ts
id: string;
```

###### surfacesCount?

```ts
optional surfacesCount?: number;
```

##### visualizePrintAreas

```ts
visualizePrintAreas: boolean;
```

## References

### widget

Renames and re-exports [AuWidgetMockupPreviewAJAX](#auwidgetmockuppreviewajax)
