---
title: WidgetImage
description: Image element shown in widget.
---

Image element shown in widget.

An image shown in a widget. You do not create instances of this element directly. Instead you should call `addImage()` on an instance of a `ListWidget`.

## Properties

### borderColor

Border color.

```typescript
borderColor: Color
```

Color of the border around the image. Defaults to black.

### borderWidth

Border width.

```typescript
borderWidth: number
```

Width of the border around the image. Defaults to 0.

### containerRelativeShape

Shape the image relative to its container.

```typescript
containerRelativeShape: bool
```

When true the corners of the image will be rounded relative to the containing widget. The value of `cornerRadius` is ignored when this is true. Defaults to false.

### cornerRadius

Radius of the corners.

```typescript
cornerRadius: number
```

Radius of the rounded corners. This property is ignored when `containerRelativeShape` is set to true. Defaults to 0.

### image

Image to show in widget.

```typescript
image: Image
```

### imageOpacity

Opacity when shown in widget.

```typescript
imageOpacity: number
```

Opacity of the image. This must be a value between 0 and 1. Defaults to 1.

### imageSize

Size of the image in the widget.

```typescript
imageSize: Size
```

Size of the image. When set to null, the image will be shwon at its full size. Defaults to null.

### resizable

Whether the image is resizable.

```typescript
resizable: bool
```

When set to true, the image can be resized. Defaults to true.

### tintColor

Tint color of the image.

```typescript
tintColor: Color
```

Changes the color of the image. Set to `null` to show the original image. Defaults to `null`.

### url

URL to open.

```typescript
url: string
```

The URL will be opened when the text is tapped. This is only supported in medium and large widgets. Small widgets can only have a single tap target, which is specified by the `url` on the widget.

## Methods

<span id="-applyfillingcontentmode" class="api-anchor"></span>

### applyFillingContentMode()

Uses filling content mode.

```typescript
applyFillingContentMode()
```

The image will fill the available space.

<span id="-applyfittingcontentmode" class="api-anchor"></span>

### applyFittingContentMode()

Uses fitting content mode.

```typescript
applyFittingContentMode()
```

The image will fit the available space. This content mode is the default.

<span id="-centeralignimage" class="api-anchor"></span>

### centerAlignImage()

Center aligns the image.

```typescript
centerAlignImage()
```

Specifies that image should be center aligned.

<span id="-leftalignimage" class="api-anchor"></span>

### leftAlignImage()

Left aligns the image.

```typescript
leftAlignImage()
```

Specifies that image should be left aligned. This is the default.

<span id="-rightalignimage" class="api-anchor"></span>

### rightAlignImage()

Right aligns the image.

```typescript
rightAlignImage()
```

Specifies that image should be right aligned.