Skip to content
phroun edited this page Aug 22, 2026 · 2 revisions

Wire name spacer

Empty space. It draws nothing and exists to push other things apart.

new panel layout=hbox children={
	new button caption="Help"
	new spacer stretch=1
	new button caption="OK"
	new button caption="Cancel"
}

That row puts Help at the left and the other two at the right, because the spacer takes every unit the row has left over.


Properties

Property Type Default Meaning
height int Explicit spacer height in units
width int Explicit spacer width in units

Plus the common properties.

width and height give a spacer a fixed size in units. stretch makes it elastic instead, taking whatever the row or column has left over. A spacer with neither takes its minimum and pushes nothing.

Events

spacer emits no events.

Spacer or spacing?

Both make gaps, and they are for different jobs.

Use
spacing on the panel An even gap between every child.
spacer with width/height One gap of a known size, in one place.
spacer with stretch One elastic gap that absorbs the leftover room.

Reach for spacing first — a row that needs a spacer between every pair of controls is a row that wanted spacing.

See also

Panelspacing, layout · Common Propertiesstretch · Separator

Clone this wiki locally