InputWithLabel

Components/Form/InputWithLabel

Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/inputwithlabel

Overview

Copy

InputWithLabel allows you to insert short text values in a field with a built-in label. It's constructed by wrapping a regular <Input/> component with <LabeledElement/>.

Do

  • Use it to insert text values in the Wix Premium checkout form.

Don't

  • Don't use it in Wix Business Manager applications, use <FormField/> with <Input/> instead.

Feature examples

Status

Control component status using `status` prop. It supports two states:
 - `error` - use it to highlight an invalid value
 - `warning` - use it to highlight a value that impacts user business or can't be validated

Explain the status with `statusMessage` prop.

Copy

Status Message

Explain the status with `statusMessage` prop. The message is shown below the field, next to the status icon.

Copy

Disabled

Disable all input interactions with `disabled` prop. Use it to highlight unavailable functions.

Copy

Suffix

Explain field values with additional information added to the `suffix` area. This prop accepts text, icons and even buttons. It accepts an array of objects as well.

Copy

Type

Control an acceptable value format with the `type` prop. This component accepts all native HTML types.

Copy

Max length

Restrict the number of characters that can be entered into a field with the `maxLength` prop.

Copy

Bottom line border

Style the component using `border` prop. It supports 2 styles:
 - `default` - use in all common cases.
 - `bottomLine` - use as a title which can be edited on the click.

Copy

Common use case examples

Checkout form

This input with labels can only be used to build a Premium Checkout form.

Copy

Code

Copy

Props

NameTypeDefaultDescription
ariaControlsstring—Associate a control with the regions that it controls.
ariaDescribedbystring—Associate a region with its descriptions. Similar to aria-controls but instead associating descriptions to the region and description identifiers are separated with a space.
ariaLabelstring—Define a string that labels the current element in case where a text label isn't visible on the screen.
ariaRoledescriptionstring—Sets the aria-roledescription attribute of the <input> element, giving assistive technologies a readable description of its role.
autocompletestring—Sets the value of the native autocomplete attribute, for example off or email.
autoFocusboolean—Focus the element on mount (standard React input autoFocus)
autoSelectboolean—Automatically selects the entire input text.
backgroundColorstring—Sets the background color of the input. Accepts any CSS color value.
border"standard" | "bottomLine"—Control the border style of input.
childrenReactNode—
clearButtonboolean—Displays clear button (X) on a non-empty input.
clearButtonAriaLabelstring—Aria label for the clear button.
clearButtonTooltipContentReactNode—When provided, hovering displays a tooltip with this content.
clearButtonTooltipPropsTooltipCommonProps—Clear button tooltip props.
customInputReactNode | Function—Render a custom input instead of the default html input tag.
dataHookstring—Applies a data-hook HTML attribute that can be used in the tests.
defaultValuestring | number—Defines the initial value of an input.
disabledboolean—Specifies whether input should be disabled or not.
disableEditingboolean—Restricts input editing.
enterKeyHint"search" | "enter" | "done" | "go" | "next" | "previous" | "send"—Sets the label of the virtual keyboard's enter key on touch devices.
focusOnClearClickboolean—Specifies whether to focus the field when clear button is clicked.
hideStatusSuffixboolean—Specifies whether status suffix should be hidden.
idstring—Assigns a unique identifier for the root element.
inputmodestring—Sets the value of the native inputmode attribute, which tells mobile browsers which on-screen keyboard to show, for example numeric or email.
inputRefnull | (instance: HTMLInputElement | null) => void | RefObject<HTMLInputElement>—Ref to the underlying <input> DOM element. Accepts callback and object refs. Use for input masking libraries such as use-mask-input. Memoize callback refs to avoid reattaching on every render.
labelstring—Sets the field label.
maxnumber—Sets a maximum value of an input. Similar to html5 max attribute.
maxLengthnumber—Sets the maximum number of characters that can be inserted to a field.
menuArrowboolean—Specifies whether input should have a dropdown menu arrow on the right side.
minnumber—Sets a minimum value of an input. Similar to HTML5 min attribute.
namestring—Reference element data when a form is submitted.
noLeftBorderRadiusboolean—Specifies whether input shouldn't have rounded corners on its left.
noRightBorderRadiusboolean—Specifies whether input shouldn't have rounded corners on its right.
onBlurFocusEventHandler—Defines a standard input onBlur callback.
onChangeChangeEventHandler—Defines a standard input onChange callback.
onClear(event: KeyboardEvent<HTMLButtonElement> | MouseEvent<HTMLButtonElement, MouseEvent>) => void—Displays clear button (X) on a non-empty input and calls a callback function.
onCompositionChange(isComposing: boolean) => void—Defines a callback function called on compositionstart/compositionend events.
onCopyClipboardEventHandler<HTMLInputElement>—Defines a callback handler that is called when user copies text to a clipboard (using a mouse or keyboard shortcut)
onEnterPressedKeyboardEventHandler<HTMLInputElement>—Defines a callback handler that is called when the user presses -enter-.
onEscapePressedKeyboardEventHandler<HTMLInputElement>—Defines a callback handler that is called when the user presses -escape-.
onFocusFocusEventHandler—Defines a standard input onFocus callback.
onInputClickedMouseEventHandler—Defines a standard input onClick callback.
onKeyDownKeyboardEventHandler<HTMLInputElement>—Defines a standard input onKeyDown callback.
onKeyUpKeyboardEventHandler<HTMLInputElement>—Defines a standard input onKeyUp callback.
onPasteClipboardEventHandler<HTMLInputElement>—Defines a callback handler that is called when user pastes text from a clipboard (using a mouse or keyboard shortcut)
patternstring—Sets a pattern that typed value must match to be valid (regex)
placeholderstring—Sets a placeholder message to display.
prefixReactNode—Pass a component you want to show as the prefix of the input, e.g., text, icon.
readOnlyboolean—Specifies whether input is read only.
refnull | string | (instance: InputImperativeActions | null) => void | RefObject<InputImperativeActions>—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
requiredboolean—Specifies whether input is mandatory.
rolestring—Specifies the role of the input element for accessibility.
rtlboolean—Specifies text direction. If true, the text is displayed from right to left.
size"small" | "tiny" | "medium" | "large"—Controls the size of the input. Default value: medium
status"error" | "warning" | "loading"—Specify the status of a field.
statusMessageReactNode—Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed.
statusMessageTooltipPropsTooltipCommonProps—Status message tooltip props.
stepnumber—Specifies the interval between number values.
suffixReactNode—Pass a component you want to show as the suffix of the input, e.g., text, icon.
tabIndexnumber—Indicates that element can be focused and where it participates in sequential keyboard navigation.
textOverflow"ellipsis" | "clip"—Handles text overflow behavior. It can either clip (default) or display ellipsis.
tooltipPlacement"right" | "left" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom-start" | "left-end" | "left-start"—Controls placement of a status tooltip.
typestring—Specifies the type of <input/> element to display. Default is text.
valuestring | number—Specifies the current value of the element.
withSelectionboolean—

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
getSuffixesCountGets the amount of rendered suffixes
hasErrorMessageReturns true if an error status message exists
getErrorMessageGets the error status message
getValue—
clickInput—
enterText—
getLabelText—
isCustomInput—
isFocusedStyle—
getMaxLength—
getPlaceholder—
existsChecks whether the component found with the given data hook.
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

  • 1.344.0 (2026-10-28) — maintenance release, no component-specific changes
  • 1.339.0 (2026-10-19) — maintenance release, no component-specific changes
  • 1.338.0 (2026-10-15) — maintenance release, no component-specific changes
  • 1.336.0 (2026-10-13) — maintenance release, no component-specific changes
  • 1.330.3 (2026-09-29) — maintenance release, no component-specific changes
  • 1.328.0 (2026-09-22) — maintenance release, no component-specific changes
  • 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.310.0 (2026-08-10) — maintenance release, no component-specific changes
  • 1.295.0 (2026-07-03) — maintenance release, no component-specific changes
  • 1.292.0 (2026-06-22) — maintenance release, no component-specific changes
  • 1.291.0 (2026-06-19) — maintenance release, no component-specific changes
  • 1.288.0 (2026-06-15) — maintenance release, no component-specific changes
  • 1.273.0 (2026-04-30) — maintenance release, no component-specific changes
  • 1.266.0 (2026-04-07) — maintenance release, no component-specific changes
  • 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
  • 1.254.0 (2026-02-03) — maintenance release, no component-specific changes
  • 1.242.0 (2025-12-19) — maintenance release, no component-specific changes
  • 1.228.0 (2025-11-18) — maintenance release, no component-specific changes
  • 1.147.0 (2024-12-13) — maintenance release, no component-specific changes
  • 1.138.1 (2024-10-30) — maintenance release, no component-specific changes
  • 1.115.0 (2024-07-17) — maintenance release, no component-specific changes
  • 1.112.0 (2024-07-03) — maintenance release, no component-specific changes
  • 1.108.0 (2024-06-03) — maintenance release, no component-specific changes
  • 1.102.0 (2024-04-16) — maintenance release, no component-specific changes
  • 1.92.1 (2024-02-05) — maintenance release, no component-specific changes

Last updated: 30 October 2026

Did this help?