Wrap

Here's an example of how you can use a Wrap widget in your project:
- First, drag the Container widget from the Layout Elements tab (in the Widget Panel) or add it directly from the widget tree and set its width to infinity and height to 200.
- Add the Wrap widget from the Layout Elements tab inside the Container.
- Add the Button widget inside the Wrap widget.
- Copy-Paste and add a few more Button widgets.

See how the Button that won't fit in the remaining space is placed in the next line.
In the example above you saw that the items are added in the horizontal direction, which is a default axis for adding items.
To change the direction in which the items are added:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to the Wrap Properties section.
- Spot the Direction dropdown, change it to Vertical.
The Horizontal Direction makes the Wrap widget work like a Row while the Vertical Direction makes the Wrap widget work like a Column.
.gif?alt=media&token=33aaaac8-e067-4b2a-b101-ae6e4675561b)
To add space between items:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to the Wrap Properties section.
- In the Spacing input box, enter the value as 10. If the Direction is set to Horizontal, Wrap will insert the empty space of 10px vertically between the items. and If the Direction is set to Vertical, Wrap will insert the empty space of 10px horizontally between the items.
- In the Run Spacing input box, enter the value as 15. If the Direction is set to Horizontal, Wrap will insert the empty space of 15px horizontally between the items. and If the Direction is set to Vertical, Wrap will insert the empty space of 15px vertically between the items.
.gif?alt=media&token=8bf860e5-4602-4981-84b9-32cb89bbc2a9)
The default Main Axis for a Wrap Widget is the horizontal axis, so adjusting this will change how the child widgets are horizontally distributed in the Wrap widget.
To change the Alignment:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to Alignment.
- Select from the options displayed including Start, Center, End, Space evenly, Space between, and Space around.
.gif?alt=media&token=7dde8651-f01b-41c2-a11f-e8bbd2f5b7d4)
The default Run Axis for a Wrap Widget is the vertical axis, so adjusting this will change how the child widgets are vertically distributed in the Wrap widget.
To change the Run Alignment:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to Run Alignment.
- Select from the options displayed including Start, Center, End, Space evenly, Space between, and Space around.
.gif?alt=media&token=096bb4e1-8f9d-4a80-97cc-3fbff676766d)
By default, the new items are always added from top to bottom direction. In a very rare case, you may need to change this behavior.
To add items from the bottom to top:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to Vertical Direction.
- Set the Dropdown value to Up.
- Try adding items.
.gif?alt=media&token=09cc8190-2472-4951-8b4b-5cb8d21671ee)
If you add several items to the Wrap widget that exceed the size of the patent widget, the Wrap widget will continue to display the overflowing items. However, you can choose to hide the overflowing items using the Clip Behaviour property:
To clip the overflowing items:
- Select the Wrap from the widget tree or from the canvas area.
- Move to the Property Editor and scroll down to Clip Behaviour.
- Change it to Clip Content.
.gif?alt=media&token=c4f2de4d-28af-47bc-8244-21427f5231a2)
Last modified 1yr ago