Skip to main content

Overview

The InputRenderable component provides a single-line text input field with support for placeholders, validation, and keyboard navigation. It extends TextareaRenderable with single-line constraints.

Basic Usage

Props

string
default:"''"
Initial text value (newlines are automatically stripped)
string
default:"''"
Placeholder text shown when input is empty
number
default:"1000"
Maximum number of characters allowed
ColorInput
default:"'transparent'"
Background color when unfocused
ColorInput
default:"'#FFFFFF'"
Text color when unfocused
ColorInput
default:"'transparent'"
Background color when focused
ColorInput
default:"'#FFFFFF'"
Text color when focused
ColorInput
default:"'#666666'"
Color of placeholder text
InputKeyBinding[]
Custom key bindings (inherits from TextareaRenderable)
KeyAliasMap
Custom key aliases for remapping keyboard shortcuts

Events

input

Fired on every character change (insertion or deletion).

change

Fired when the input loses focus or when Enter is pressed, if the value has changed since focus.

enter

Fired when the Enter key is pressed.

Methods

value

Get or set the input value programmatically.

maxLength

Get or set the maximum character limit.

placeholder

Get or set the placeholder text.

focus()

Programmatically focus the input.

blur()

Programmatically blur the input.

Behavior

  • Single-line only: Height is always 1, newlines are stripped from pasted or typed text
  • Enter key: Submits the form (fires enter event) instead of inserting a newline
  • Text wrapping: Disabled (wrapMode is set to “none”)
  • Undo/Redo: Full undo/redo support inherited from TextareaRenderable
  • Selection: Text selection is supported with shift + arrow keys

Keyboard Shortcuts

Inherits all keyboard shortcuts from TextareaRenderable:

Examples

Login Form

Character Counter

Validated Input