Skip to content

UI Spacer

Updated

Invisible flexible gap that pushes siblings apart.

Type
comp-ui-spacer
Script class
UISpacerComponent
Per entity
One
Version
1.1.0

Read about it in Panels and layout: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
grow 0 ≤ x ≤ 1000
margin
margin[] -16384 ≤ x ≤ 16384
padding
padding[] 0 ≤ x ≤ 16384
size 0 ≤ x ≤ 16384

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(UISpacerComponent);
if (component) log(component.props);
}