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?: BlazeWidgetItemImagePositionPosition enum value that defines the position of the image within the widget item.
Applies only when the image has an absolute value.
thumbnailType
thumbnailWidgetType?: BlazeThumbnailTypeA 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?: numberAn optional number value that defines the width of the image.
height
height?: numberAn optional number value that defines the height of the image.
ratio
ratio?: numberAn 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?: numberA number value that defines the corner radius of the image.
cornerRadiusRatio
cornerRadiusRatio?: numberThe 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.
| Value | Description |
|---|---|
| TopStart | The image is positioned at the top start corner. |
| TopCenter | The image is positioned at the top center. |
| TopEnd | The image is positioned at the top end corner. |
| CenterStart | The image is positioned at the center start edge. |
| Center | The image is positioned at the center. |
| CenterEnd | The image is positioned at the center end edge. |
| BottomStart | The image is positioned at the bottom start corner. |
| BottomCenter | The image is positioned at the bottom center. |
| BottomEnd | The image is positioned at the bottom end corner. |
ThumbnailWidgetType Enum
The ThumbnailWidgetType enum defines the type of the image thumbnail:
| Value | Description |
|---|---|
| SquareIcon | Use the 1:1 thumbnail image defined as the thumbnail |
| VerticalTwoByThree | Use the 2:3 thumbnail image defined as the thumbnail |
| Custom | Use the main thumbnail image defined as a custom thumbnail |
Updated 11 days ago
