Skip to content

TextInput

A single-line text field. The inspector renders a plain text input.

Runtime value: string

TextInput inspector control

Declaration

ts
import { Behaviour, type TextInput } from "@relu-interactives/spatial-ecs";

export default class Demo extends Behaviour {
  data = {
    label:   "Hello world" as TextInput,
    apiKey:  "" as TextInput,
  };
}

Runtime usage

Use the value directly as a string:

ts
init() {
  console.log(this.data.label); // "Hello world"
}

Notes

  • The default value is what the user sees when the script is first attached.
  • Useful for URLs, display strings, or any freeform text parameter.