Skip to main content

Interface: ImageWidgetProps

Hierarchy​

Properties​

imageWidth​

• imageWidth: number

Width of the image


imageHeight​

• imageHeight: number

Height of the image


image​

• image: ImageWidgetSource

Image loaded using require('./path/to/image'), or a path to image starting with "http:", "https:", or "data:/image"


style​

• Optional style: CommonStyleProps


radius​

• Optional radius: number

Image radius


resizeMode​

• Optional resizeMode: "center" | "stretch" | "cover" | "contain"

How the image should be resized when its aspect ratio differs from the view.

Defaults to Android's ImageView behavior, which is equivalent to contain.


clickAction​

• Optional clickAction: string

A string that will define an action that will be emited when clicking the widget.

There are a few special values for clickAction that will not emit the action, but will execute the action in the background.

Those are:

  • "OPEN_APP" - This clickAction does not require clickActionData, and if set on a section of the widget it will open the application when clicked
  • "OPEN_URI" - This clickAction requires a clickActionData that contains { uri: 'some-uri' }. The uri can be a web uri (https://google.com), or an app deep link (androidwidgetexample://deep-link) For the link to open a screen in the app deep linking must be set up

Inherited from​

ClickActionProps.clickAction


clickActionData​

• Optional clickActionData: Record<string, unknown>

Additional data that will be passed when the widget is clicked.

If clickAction is OPEN_URI it must contain { uri: 'some-uri' }

Inherited from​

ClickActionProps.clickActionData


accessibilityLabel​

• Optional accessibilityLabel: string

Accessibility label for screen readers. Can be set on the root component or any clickable component. When set on the root component, it applies to the entire widget. When set on a clickable component, it describes that specific clickable area.

Inherited from​

ClickActionProps.accessibilityLabel