Skip to content

UITextInput

UITextInput is a class that allows the user to enter text.

Inherits UIView

Events

Changed

An event that is fired when the value of the text input changes.

Example

element.Changed:Connect(function()
    print(element.Text)
end)

Submitted

The event that is triggered when the user submits the text in a text input.

Example

element.Submitted:Connect(function()
    print(element.Text)
end)

Properties

AutoSize : boolean

Whether the text should be automatically sized to fit the label's size.

Example

element.AutoSize = true

Font : TextFontPreset

The font of the label.

Example

element.Font = TextFontPreset.Montserrat

FontSize : float

The font size of the label.

Example

element.FontSize = 20

IsMultiline : boolean

Set if the text input can be multiline.

Example

element.IsMultiline = true

IsReadOnly : boolean

Set if the text input can be edited or not.

Example

element.IsReadOnly = true

JustifyText : TextJustify

Determines how the text is justified.

Example

element.JustifyText = TextJustify.Center

MaxFontSize : float

The maximum font size of the UI element if AutoSize is set to true.

Example

element.MaxFontSize = 16

Placeholder : string

The placeholder of the text input.

Example

element.Placeholder = "Type here..."

PlaceholderColor : Color

The color of the placeholder text.

Example

element.PlaceholderColor = Color.New(0, 0, 0, 0.5)

Text : string

The text of the label.

Example

element.Text = "Hello, World!"

TextColor : Color

The color of the text.

Example

element.TextColor = Color.New(0, 0, 0, 1)

VerticalAlign : TextVerticalAlign

The vertical alignment of the text.

Example

element.VerticalAlign = TextVerticalAlign.Middle