NUI / Components / Input

EditableText

ImplementedInput

EditableText allows a user to edit a single line of text.

Supported as a lightweight editable text field.

Overview

EditableText allows a user to edit a single line of text.

When to use

  • Lightweight text entry where minimal field styling is enough.

Children

Does not support children.

Basic syntax

nui
EditableText PlayerName {
    text: "Player"
    placeholder: "Enter name"
}

Supported properties

PropertyTypeRequiredDefaultDescription
textstringNoEmptyInitial text value.
placeholderstringNoEmptyPlaceholder text.
enabledboolNotrueWhether the field can be used.
focusableboolNotrueWhether the field can receive focus.
fontstringNoProject defaultField font name.
fontSizenumberNo14Text size.
textColorcolorNoDefaultText color.
placeholderColorcolorNoDefaultPlaceholder color.
selectionColorcolorNoDefaultSelection highlight color.
caretColorcolorNoDefaultCaret color.
textAlignenumNoleftHorizontal text alignment.
verticalTextAlignenumNocenterVertical text alignment.
paddingmarginNoDefaultText padding.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
opacitynumberNo1Render opacity.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

EditableText may receive stack, canvas, grid, wrap, or ExpandableArea slot properties only when it is authored as a direct child of the matching parent. See section 7.

Full syntax example

nui
EditableText PlayerName {
    text: "Player"
    placeholder: "Enter name"
    enabled: true
    focusable: true
    font: "BodyFont"
    fontSize: 16
    textColor: "#F8FAFC"
    placeholderColor: "#94A3B8"
    selectionColor: "#2563EB"
    caretColor: "#FFFFFF"
    textAlign: left
    verticalTextAlign: center
    padding: margin(6, 8, 6, 8)
    width: 240
    height: 36
    opacity: 1
    visible: true
}

Limitations

  • Current public docs should treat this as a single-line field.
  • Multiline text editing is planned separately.