Components
Text Input

Text Input

An input for entering text.

Properties

NameTypeDescription
WidthFusion.UsedAs<UDim>?The width of the text input. (Defaults to UDim.new(1, 0)).
PlaceholderFusion.UsedAs<string?>The placeholder for the text input.
ValueFusion.UsedAs<string?>The value of the text input.
VariantFusion.UsedAs<"Primary" | "Secondary" | nil>?The variant for the text input. (Defaults to "Primary").
KeybindFusion.UsedAs<{ Enum.KeyCode }>?Specifies a keybind that can be used to focus the text input.
ValidationValidationProps | string | nilSpecifies a pattern that the text input's data must conform to.

Validation Properties (ValidationProps)

NameTypeDescription
PatternFusion.UsedAs<string>The string pattern (opens in a new tab) that the text input's data must conform to.
ModeFusion.UsedAs<"Restrict" | "ErrorVisual" | nil>Restrict prevents data that does not match the pattern from being inside of the text input whilst ErrorVisual shows a red outline around the text input when its data does not conform to the pattern.

Example

Scope:TextInput {
  Value = "7205",
  Keybind = { Enum.KeyCode.LeftControl, Enum.KeyCode.K },
  Validation = { Pattern = "%d+", Mode = "Restrict" :: "Restrict" },
}