Image
Last updated
Last updated
The Image widget shows an image from uploaded assets or the URL link. The Image widget can display images such as JPEG and PNG.
Here's how you add the Image widget to your project:
Select the Image widget from the Add Widget Button or add it directly from the widget tree.
Under Widget Properties (on the right side of your screen), scroll down to Image Source section.
Find the Network property for Image Type and enter the URL for the new image.
Here are the instructions for changing the Image type.
To show the data retrieved from API Calls into the Image widget, ensure you:
Understand how API Calls function.
Completed all steps to define the API Call.
Correctly defined DataSource for Widgets wrapping the Image widget.
Finally, to show data into the Image widget, click on the variable icon besides the Image Source, and enter the value according to the API's endpoints.
Changing the Box Fit value allows you to control how the image should display inside the Image widget. Various options under the Box Fit property helps you scale (grow or shrink in size) the image inside the Image widget.
To change the Box Fit value:
Select Image from the widget tree or from the canvas area.
Move to the Property Editor (on the right side of your screen) and scroll down to the Image section.
Find the Box Fit dropdown, try changing it to the other values to get the perfect image.
Here are all the options that are available for the Box Fit property.
Fill: It shows the image as the exact size of the Image widget by distorting the image’s aspect ratio.
The aspect ratio is expressed as a ratio of width to height. For example, a 16:9 width:height aspect ratio would have a value of 16.0/9.0.
You can customize the appearance and behavior of this widget using the various properties available under the Styling Properties dropdown.
To change the image size, move the Styling Properties Panel > find the Width and Height properties. You have two choices for setting the size:
For a specific size, choose PX and type in the size you want.
For a size based on the screen, choose % and type in the percentage.
The size of an image within a container is limited by the container's own dimensions. To make the image bigger, you'll need to enlarge the container as well.
Changing the Border Radius allows you to create rounded corners for the image.
Here's an example of how to create rounded corners:
Select Image from the widget tree.
Move to the Widget Properties (on the right side of your screen) and select Styling Properties.
Find the Border Radius property enter the values you want. The value can be set for all corners which are TL (Top left), TR (top right), BL (bottom left), and BR (bottom right).
See how to work with Widget Styling, Visibility, Padding and Alignment here.