Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/variableinput
Variable input allows you to display <Tag/> components in between plain text. Each tag represents a known variable. Input recognizes predefined text strings and matches them with an assigned variable when input loses focus (on blur).
<Multiselect/> with manual input feature instead.Adjust the component size using the size prop. It supports 3 sizes:
large - use when the input needs emphasis.medium (default) - use for all common cases.small - use in dense and narrow layouts.Control the component status using the status prop. It supports 3 states:
error - use to highlight an invalid input.warning - use to highlight inputs that impact users or can't be validated.loading - use to show that the value is being uploaded to the server.Add text that explains the status or what action the user should take with the statusMessage prop.
Showing the status message inline, directly below the input is preferred in all default cases.
<FormField/> and add the statusMessage.statusMessage prop.View more inline status message examples in <FormField/>.
Control input interaction with:
readOnly - disables writing new values, but allows to copy the current value.disabled - disables all input interactions. Use to highlight unavailable functions.Set the height of a component to fit a specified number of text lines with rows prop.
Control content scroll direction with the multiline prop.
Multiline is allowed by default. Disabling it results in content scrolling horizontally inside of an input.
Use a button outside of an input to allow user to embed variables from a predefined list manually.
Use the variable input to send personalized messages and updates.
| Name | Type | Default | Description |
|---|---|---|---|
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
disabled | boolean | — | Specifies whether input should be disabled or not. |
initialValue | string | '' | Defines an initial value to display. |
multiline | boolean | true | Specifies whether component allow multiple lines or not. If false, text doesn't wrap and a horizontal scroll appears inside the component. |
onBlur | (value: string) => void | — | Defines a callback function that is called on focus out: onBlur(value: String): void |
onChange | (value: string) => void | — | Defines a callback function that is called each time value is changed: onChange(value: String): void |
onFocus | (value: string) => void | — | Defines a callback function that is called on focus in: onFocus(value: String): void |
onSubmit | (value: string) => void | — | Defines a callback function that is called on value submit, in other words after insertVariable() and setValue() and insertText() onSubmit(value: String): void |
placeholder | string | — | Sets a placeholder message to display. |
readOnly | boolean | — | Specifies whether input is read only. |
rows | number | 1 | Set the height of a component to fit the given number of rows. |
size | "small" | "tiny" | "medium" | "large" | — | Controls the size of the input and variable tags. |
spellCheck | boolean | false | Specifies whether spellcheck is enabled. |
status | "error" | "warning" | "loading" | "success" | — | Specify the status of a field. |
statusMessage | ReactNode | — | Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed. |
variableParser | (value: string) => string | boolean | — | Defines the variable keys that the component parses and converts to insertVariable. For each key, variableParser is called and should return a proper text for that key or false in case the key is invalid. variableParser(key: String): String|boolean |
variableTagPropsParser | (value: string) => Partial<TagProps> | — | A function callback that is being called on each keyboard enter and expects a return of object with properties meant for Tag component. It is designed to dynamically determine the styling or properties applied to variable tags within the input field.` |
variableTemplate | { prefix: string; suffix: string; } | — | Defines a template for variable recognition. Typed text strings with matching prefix and suffix symbols are converted to |
No testkit for this component — it doesn't expose a unidriver testkit.
variableKey to focus public method (#14979)focus public method (#14817)Last updated: 22 October 2026