Skip to main content

Textfield

info

For more details about Vuetify’s usage of TextField component, click TextField page.
For more prop explanations, click Vuetify TextField API page.

Props

NameTypeDefaultDescription
appendIconAppends an icon to the component, uses the same syntax as Icon.stringundefined
appendOutherIconAppends an icon to the outside the component’s input, uses same syntax as Icon.stringundefined
autofocusEnables autofocus.booleanfalse
classProp that determines the class to add to the Textfieldstringundefined
clearIconApplied when using clearable and the input is dirty.string'$clear'
clearableAdd input clear functionality, default icon is Material Design Icons mdi-clear.booleanfalse
counterCreates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation.boolean-number-stringundefined
counterValuefunctionnull-
compareValueQLegend is used for comparison values. You can look at the QLegend document.stringundefined
compareTextQLegend is used for comparison values. You can look at the QLegend document.stringundefined
compareTableValueQLegend is used for comparison values. You can look at the QLegend document.stringundefined
darkApplies the dark theme variant to the component. This will default the components color to white unless you’ve configured your application theme to dark or if you are using the color prop on the component. You can find more information on the Material Design documentation for dark themes.booleanfalse
disabledDisable the input.booleanfalse
errorPuts the input in a manual error state.booleanfalse
errorCountThe total number of errors that should display at once.number-string1
errorMessagesPuts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the rules prop. This field will not trigger validation.string-array[ ]
hideDetailsHides hint and validation errors. When set to auto messages will be rendered only if there’s a message (hint, error message, counter value etc) to display.boolean-stringundefined
hintHint text.stringundefined
labelSets input label.stringundefined
loadingDisplays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - primary, secondary, success, info, warning, error) or a Boolean which uses the component color (set by color prop - if it’s supported by the component) or the primary colorboolean-stringfalse
nameApplies the name attribute to the html input element. For the VForm component, the name prop can be used to target a form submission.stringundefined .
maxLengthmaxlength for txtvalidationcode.number
persistentHintForces hint to always be visible.booleanfalse
persistentPlaceholderForces placeholder to always be visible.booleanfalse
placeholderSets the input’s placeholder text.stringundefined
prefixDisplays prefix text.stringundefined
prependIconPrepends an icon to the component, uses the same syntax as Icon.stringundefined
prependInnerIconPrepends an icon inside the component’s input, uses the same syntax as Icon.stringundefined
readonlyPuts input in readonly state.booleanfalse
rulesAccepts a mixed array of types function, boolean and string. Functions pass an input value as an argument and must return either true / false or a string containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) false or is a string.array[ ]
stepSpecifies focus order.stringundefined
soloChanges the style of the input.booleanfalse
soloInvertedReduces element opacity until focused.booleanfalse
successPuts the input in a manual success state.booleanfalse
successMessagesPuts the input in a success state and passes through custom success messages.
suffixDisplays suffix text.stringundefined
typeSets input type.string'text'
validateOnBlurDelays validation until blur event.booleanfalse
valueThe input's value.anyundefined
visibleVisibility of TextField component.booleantrue

Events

NameDescriptionType
blurEmitted when the input is blurredEvent
changeEmitted when the input is changed by user interactionany
clickEmitted when input is clickedMouseEvent
click:appendEmitted when appended icon is clickedEvent
click:append-outerEmitted when appended outer icon is clickedEvent
click:clearEmitted when clearable icon clickedEvent
click:prependEmitted when prepended icon is clickedEvent
click:prepend-innerEmitted when prepended inner icon is clickedEvent
focusEmitted when component is focusedEvent
inputThe updated bound modelany
keydownEmitted when any key is pressedKeyboardEvent
mousedownEmitted when click is pressedMouseEvent
mouseupEmitted when click is releasedMouseEvent
mousewheelEmitted when scrolling within the componentMouseEvent
update:errorThe error.sync eventboolean

Slots

NameDescription
appendAdds an item inside the input and after input content
append-outerAdds an item outside the input and after input content
counter{props: {dark: boolean,light: boolean,max: string or number, value: string}}
labelReplaces the default label
message{key: number, // the messages index,message: string, // the message}
prependAdds an item outside the input and before input content
prepend-innerAdds an item inside the input and before input content
progressSlot for custom progress linear (displayed when loading prop is not equal to Boolean False)

To reach data formatting options on editor with Quick methods check [Data Formatting]/UI-Screens/Logic/data-formatting) page.

To use data formatting options on the QUI project, check Settings.yaml page.

Number Format Usage

The following format options can be used to format the ‘number’ values. However, if groupseperator and radixpoint are set with the use as default option in the settings of the application, these values you set will be invalid.

  • Drag and Drop TextField component

  • Set format prop 'number'

  • Set formatValues prop with needed format options

    Example Setting FormatValues

    {'alias'='decimal','groupSeparator'='.','radixPoint'=',','digits'=2,'enforceDigitsOnBlur'=true}

image

number

Number Format Options

OptionsValuesDescriptionType
aliasnumeric, currency, decimal, integer, percentageThe defaults are those defined in the base numeric alias. The currency alias and others are derived from the numeric alias and can have other defaults.string
digitsThe value can be a number, *, or a quantifier syntax like 2,4 When the quantifier syntax is used, the digitsOptional option is ignorednumber
digitsOptionaltrue,falseSpecify wheter the digits are optional. Default: trueboolean
enforceDigitsOnBlurtrue,falseEnforces the decimal part when leaving the input field. Default: falseboolean
radixPointDigit sembols .default: "."string
groupSeparatorthousand seperator sembols. default: ""string
allowMinustrue,falseAllow to enter -.Default: trueboolean
prefixDefine a prefix.Default: ""string
suffixDefine a suffix.Default: ""string
minMinimum value.Default: undefinednumber
maxMaximum value.Default: undefinednumber
shortcutsDefine shortcuts. This will allow typing 1k => 1000, 2m => 2000000. To disable just pass null Default: {k: "000", m: "000000"}{k: number, m: number }
rightAligndefault: trueAlign the input to the rightboolean

Quick Number Format Options

OptionsValuesDescriptionType
quicktrue,falseTo use the quickInputFormat library, which was developed due to formatting and performance problems in the inputmask library.boolean
aliasnumeric, currency, decimal, integer, percentageThe defaults are those defined in the base numeric alias. The currency alias and others are derived from the numeric alias and can have other defaults.string
digitsThe value can be a number, *, or a quantifier syntax like 2,4 When the quantifier syntax is used, the digitsOptional option is ignorednumber
digitsOptionaltrue,falseSpecify wheter the digits are optional. Default: trueboolean
enforceDigitsOnBlurtrue,falseEnforces the decimal part when leaving the input field. Default: falseboolean
radixPointDigit sembols .default: "."string
groupSeparatorthousand seperator sembols. default: ""string
allowMinustrue,falseAllow to enter -.Default: trueboolean
minMinimum value.Default: undefinednumber
maxMaximum value.Default: undefinednumber
rightAligndefault: trueAlign the input to the rightboolean
TextFieldQuickInputFormat

BigDecimal Format Usage

The following format options can be used to format the ‘bigdecimal’ values. However, if groupseperator and radixpoint are set with the use as default option in the settings of the application, these values you set will be invalid.

BigDecimal Format Options

OptionsValuesDescriptionType
digitsfractional digits countnumber
radixPointDigit sembols .default: "."string
groupSeparatorthousand seperator sembols. default: ""string
integerDigitsinteger digits countnumber

BigDecimal Format Usage

  • Drag and Drop TextField component

  • Set format prop 'bigdecimal'

  • Set formatValues prop with needed format options

    Example Setting FormatValues

    {'groupSeparator'='.','radixPoint'=',','digits'=2,'integerDigits'=16}

Regex Format Usage

  • Drag and Drop TextField component.
  • Set format prop 'regex'.
  • Set formatValues prop with regex value.

Alert: "\" character must be used before "{". Ex: [0-9]{2}[A-Z]{24} must be [0-9]\{2}[A-Z]\{24}

Example Setting FortmatValues

{'regex' = '[0-9]\{2}[A-Z]\{24}'}

Formatted Component Value

To get input value from the component, use the getUnmaskedValue method

let compValue = components.{{compQID}}.getUnmaskedValue()

Samples Qjson

VTextField_formatValue_specialChars
VTextField_formatValue_exceptLetters
TextField_formatValueSample1
TextField_formatValueSapmle2
TextField_keyDown
VTextField_rangeOfNumber_validation
TextField_customValidation
TextField_FocusExample