AROYN UI LIBRARY / UI COMPONENTS

Text Input

Capture a string on focus loss, optionally requiring Enter.

Create Text Input#

Capture a string on focus loss, optionally requiring Enter.

The constructor returns a TextInput handle. The snippet assumes section exists, as created in Quick start.

LUAU
local input = section:CreateTextInput({
    Name = "Profile note", Flag = "note", Default = "", Placeholder = "Write a note",
    SubmitOnEnter = true,
    Callback = function(value) print("Submitted:", value) end,
})
Note TextInput in Roblox containing Aroyn.Open full size ↗
The showcase Note field contains “Aroyn”.

Arguments#

OptionTypeDefaultMeaning
Defaultstring""Initial text.
Placeholderstring""Hint for an empty field.
SubmitOnEnterbooleanfalseIf true, FocusLost submits only after Enter.
Callbackfunction(string)nilReceives submitted text.

Also accepts common options: Name, Description, Disabled and Callback; stateful controls additionally support Flag, Persist and Sensitive.

Manage state#

LUAU
input:SetValue("Local note")
print(input:GetValue())
input:SetDisabled(true)

Returned methods#

MethodReturnsBehavior
GetValue()stringCurrent string value.
SetValue(value, notify?)selfSilent by default; true calls Callback only after a changed normalized value.
SetDisabled(boolean)selfChanges user availability without discarding the value.
IsDisabled()booleanReads the requested disabled state.
Destroy()nilRemoves this control and its subscriptions; safe to repeat.

Behavior and limitations#

This is a string input, not a numeric validator, password field or multiline editor. Do validation in your callback.

AutoSave tracks the Text property while typing, independent of Enter submission. FocusLost can submit an unchanged string again.

Configuration serialization limits text to 16 KiB of UTF-8 bytes. Sensitive=true excludes a flag from snapshots; it does not mask the on-screen field or encrypt text.

Default, Placeholder and SetValue require strings. SubmitOnEnter and notify require booleans when supplied; invalid types assert. Text length is constrained when saving configuration, not by an on-screen character limit.