
# Class: AuBaseWidget

The base class for widgets.

## Hierarchy

* any

  ↳ **AuBaseWidget**

  ↳ [AuBaseSelectorWidget](aubaseselectorwidget.md)

  ↳ [AuWidgetDesignAtoms](auwidgetdesignatoms.md)

  ↳ [Au3dViewerBase](au3dviewerbase.md)

  ↳ [AuWidgetButton](auwidgetbutton.md)

  ↳ [AuCanvas](aucanvas.md)

  ↳ [AuDesignEditor](audesigneditor.md)

  ↳ [AuWidgetDndController](auwidgetdndcontroller.md)

  ↳ [AuWidgetHtml](auwidgethtml.md)

  ↳ [AuWidgetImageCarousel](auwidgetimagecarousel.md)

  ↳ [AuWidgetStaticText](auwidgetstatictext.md)

  ↳ [AuWidgetUploader](auwidgetuploader.md)

  ↳ [AuWidgetSlider](auwidgetslider.md)

  ↳ [AuWidgetPreflight](auwidgetpreflight.md)

  ↳ [AuWidgetVariantSelector](auwidgetvariantselector.md)

  ↳ [AuWidgetPreviewMockupSlider](auwidgetpreviewmockupslider.md)

  ↳ [AuWidgetPantoneColorPicker](auwidgetpantonecolorpicker.md)

## Implements

* [IWidget](../interfaces/iwidget.md)

## Index

### Properties

* [params](aubasewidget.md#params)

### Methods

* [checkInitDependenciesWidgets](aubasewidget.md#checkinitdependencieswidgets)
* [resetPreloaderState](aubasewidget.md#resetpreloaderstate)
* [showPreloader](aubasewidget.md#showpreloader)
* [showToast](aubasewidget.md#showtoast)

## Properties

###  params

• **params**: *any*

Compiled widget configuration.

## Methods

###  checkInitDependenciesWidgets

▸ **checkInitDependenciesWidgets**(): *string[]*

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

**Returns:** *string[]*

___

###  resetPreloaderState

▸ **resetPreloaderState**(): *void*

**Returns:** *void*

___

###  showPreloader

▸ **showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void*

Shows a preloader.

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

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`isPreload` | boolean | - | If `true`, enables the preloader. |
`message` | string &#124; string[] |  [""] | A text message that appears next to the preloader.  |
`timeout` | number | 5 | - |

**Returns:** *void*

___

###  showToast

▸ **showToast**(`data?`: string, `duration?`: number): *void*

Shows a toast.

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

**Parameters:**

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

**Returns:** *void*
