Skip to main content

WrapList

The WrapList widget is a repeating layout that lays items out in one direction and wraps them onto the next line when it runs out of space.
It works well when you have many items of different sizes and want to show them as a scrollable list.

Definition and role

WrapList renders a data list repeatedly, laying each item out along the layout direction — horizontal or vertical — and wrapping automatically when space runs out. Set maxLines to clip the items beyond that number of lines; WrapList then reports the number of clipped items (overflowCount) and the current line count (lineCount) through events.

  • Category: Layouts
  • Default layout direction: horizontal
  • Size on drop: dropped inside a parent layout such as Row, Column, or Stack, it starts at 200 x 150. Dropped at the top level with no parent, it grows to fill the remaining space.

Features

FeatureDescription
Repeated layoutRenders each entry in the data list as a repeated child widget.
Automatic wrappingMoves items to the next line when they no longer fit on the current one.
Spacing controlSet item spacing (spacing) and line spacing (runSpacing) separately.
AlignmentSet main-axis (alignment), run (runAlignment), and cross-axis (crossAxisAlignment) alignment.
Line limitLimit the number of visible lines with maxLines, and report the number of clipped items through an event.

How to use

  1. Open the Layouts category in the left widget palette.
  2. Drag the WrapList item onto the canvas.
  3. In the Properties panel on the right, set how many items to repeat using data binding or itemCount.
  4. Place the child widgets you want to repeat inside it.
  5. Adjust the layout direction, spacing, alignment, maxLines, and other settings as needed.

Properties

PropertyDescriptionDefaultValue / Type
directionItem layout directionhorizontalhorizontal, vertical
alignmentItem alignment along the main axisstartstart, end, center, spaceBetween, spaceAround, spaceEvenly
spacingSpacing between items on the same line (main axis)0Number (px)
runAlignmentAlignment of the runs (cross axis)startstart, end, center, spaceBetween, spaceAround, spaceEvenly
runSpacingSpacing between one line and the next (cross axis)0Number (px)
crossAxisAlignmentCross-axis alignment of items within a linestartstart, end, center
textDirectionHorizontal direction the main axis advances inNot setrtl, ltr
verticalDirectionVertical direction the lines stack indownup, down
clipBehaviorHow content outside the area is clippednonenone, hardEdge, antiAlias, antiAliasWithSaveLayer
itemCountNumber of items to repeat0Number
maxLinesMaximum number of lines to show (Not set = unlimited = no clipping)Not setNumber
reservedTrailingExtentMain-axis width to reserve at the end of the last line when maxLines is set — room for a "+N" badge, for exampleNot setNumber (px)

Notes and tips

tip

Leave maxLines unset — the default — and WrapList shows every item with no line limit. In that state, overflowCount and lineCount are not updated.

tip

Connect the data list you want to repeat in the Data Binding panel at the top, not in the Properties panel. If you only need a fixed count, set itemCount instead.

warning

overflowCount and lineCount are read-only output values that don't appear in the Properties panel. Read them from a script or through data binding.

Learn more

tip

For the full set of Widget Controls (Property, Method, and Event) that drive this widget from a script, visit WrapList Widget Control.