GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemImageStyle - React Native

The BlazeWidgetItemImageStyle interface is responsible for defining the appearance and layout of the image within a widget item. It includes properties for positioning, size, thumbnail type, and border customization.

Properties

position

position?: BlazeWidgetItemImagePosition

Position enum value that defines the position of the image within the widget item.

Applies only when the image has an absolute value.

thumbnailType

thumbnailWidgetType?: BlazeThumbnailType

A BlazeThumbnailType enum value that defines the type of the image thumbnail.

margins

margins?: BlazeMargins = { ... }

An BlazeMargins value that defines the insets for the image within the widget item.

width

width?: number

An optional number value that defines the width of the image.

height

height?: number

An optional number value that defines the height of the image.

ratio

ratio?: number

An number value that defines the aspect ratio of the image.

Set to 0 for automatic sizing.

If Ratio is provided along with height/width, sets the image with absolute size.

border

border?: BlazeWidgetItemImageContainerBorderStyle = { ... }

A 'BlazeWidgetItemImageContainerBorderStyle' interface that defines the appearance of the border around the image.

cornerRadius

cornerRadius?: number

A number value that defines the corner radius of the image.

cornerRadiusRatio

cornerRadiusRatio?: number

The corner radius ratio of the image container.

The corner radius ratio is a value between 0.0 and 1.0, which computes the final corner radius for the widget item. Overrides corner radius property.

For example, a value of 0.5 on a 1:1 width/height widget item will result in a perfect circle appearance for the widget item.

gradient

gradientOverlay?: BlazeWidgetGradient = { ... }

A 'BlazeWidgetGradient' struct that defines the gradient configuration over the image.

Initialization

The BlazeWidgetItemImage struct can be initialized with custom values for its properties:

interface BlazeWidgetItemImageStyle {
  position?: BlazeWidgetItemImagePosition;
  thumbnailType?: BlazeThumbnailType;
  width?: number;
  height?: number;
  ratio?: number;
  cornerRadius?: number;
  cornerRadiusRatio?: number;
  border?: BlazeWidgetItemImageContainerBorderStyle;
  gradientOverlay?: BlazeWidgetGradient;
  margins?: BlazeMargins;
}

Position Enum

The Position enum provides predefined positions for the image within the widget item and Applies only when the image has an absolute value.

ValueDescription
TopStartThe image is positioned at the top start corner.
TopCenterThe image is positioned at the top center.
TopEndThe image is positioned at the top end corner.
CenterStartThe image is positioned at the center start edge.
CenterThe image is positioned at the center.
CenterEndThe image is positioned at the center end edge.
BottomStartThe image is positioned at the bottom start corner.
BottomCenterThe image is positioned at the bottom center.
BottomEndThe image is positioned at the bottom end corner.

ThumbnailWidgetType Enum

The ThumbnailWidgetType enum defines the type of the image thumbnail:

ValueDescription
SquareIconUse the 1:1 thumbnail image defined as the thumbnail
VerticalTwoByThreeUse the 2:3 thumbnail image defined as the thumbnail
CustomUse the main thumbnail image defined as a custom thumbnail

Did this page help you?