Skip to content

UI Input

Updated

Single-line text field.

Type
comp-ui-input
Script class
UIInputComponent
Per entity
One
Version
1.3.0

Read about it in Controls: 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
flexGrow 0 ≤ x ≤ 1000
margin
margin[] -16384 ≤ x ≤ 16384
maxLength 0 ≤ x ≤ 65536, integer
maxRows 1 ≤ x ≤ 256, integer
padding
padding[] 0 ≤ x ≤ 16384

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • UIInput::change
  • UIInput::submit
  • UIInput::focus
  • UIInput::blur

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(UIInputComponent);
if (component) log(component.props);
}