Skip to main content

TextEditBox

TextEditBox wraps Roku's SceneGraph TextEditBox node and its browser simulator implementation. Use it when the edit surface should appear directly, without TextInput's TV keyboard-dialog presentation.

TextEditBox({
text: this.value,
hintText: 'Enter text',
maxTextLength: 64,
cursorPosition: this.value.length,
})
.onTextChange((event) => {
this.value = event.text ?? '';
});

Key fields are:

  • text, hintText, and secureMode;
  • cursorPosition and maxTextLength;
  • clearOnDownKey;
  • textColor and hintTextColor;
  • width (default 300) and height (default 40);
  • onTextChange.

onTextChange includes text; cursor movement is retained in cursorPosition. Handle confirmation through a separate application action, such as a focused Search or Save button. Use NativeVoiceTextEditBox for Roku voice entry.

Talk to us