Search

Components/Form

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

Overview

Copy

Search lets users enter a keyword or phrase into a text field to find relevant results.

Do

  • Use it to find relevant information on a page.
  • Use it to filter data in a table.
  • Use it to find relevant pages for easy navigation.

Don't

  • Don't use it to search addresses. Use <AtlasAddressInput/> or <AddressInput/> instead.
  • Don't use it to select multiple items. Use <MultiSelect/> or <MultiSelectCheckbox/> instead.

Feature examples

Size

Adjust the component's size using the size prop. It supports 3 sizes:

  • large is for onboarding flows, where the input needs more emphasis.
  • medium is the default used in all common cases.
  • small should only be used in dense layouts.
Copy

Border

Style the component using the border prop. It supports 4 styles:

  • round is the default used in all common cases.
  • standard is for when search is part of a form.
  • bottomLine is for titles that can be edited on selection.
  • none should be used in the Content Manager's spreadsheet cell.
Copy

Status

Control a component's status using the status prop. It supports 3 states:

  • loading is to show that a value is being uploaded to the server or that results are loading.
  • error is inherited from input, but there's no use case at the moment.
  • warning is inherited from input, but there's no use case at the moment.
Copy

Status message

Add text that explains the status or what action the user should take with the statusMessage prop.

  • To add an accessible inline message, wrap the component in a <FormField/> and add the statusMessage.
  • To add a status message in a tooltip that requires users to hover on the icon, use the statusMessage prop. Control tooltip placement with tooltipPlacement prop.

View more inline status message examples in <FormField/>.

Copy

Read-only and disabled

The component can be set to read-only or disabled. To disable users from typing into the input, but allow them to copy or remove an entered value, use the readOnly prop.

Copy

Clear button

Remove entered keywords quickly with a clear button. The button is enabled by default for all search fields. Avoid removing it if possible.

Copy

Options

Provide common suggestions by passing an array of options to a component. A predicate function can be used to filter these options.

In this example, predicate makes the search input case sensitive.

Copy

Options container dimensions

Control container size with three properties.

  • maxHeightPixels specifies the maximum height for longer lists.
  • dropdownWidth sets the width to "auto" or "max-content" to match the content width or specify it in pixels.
  • minWidthPixels increases the width of the dropdown popover manually.
Copy

Expandable

Collapse the search input into an icon button and only expand it intentionally on click with the expandable prop. Control the width of expanded input with expandWidth.

expandDirection controls the side the search opens from

Copy

Debounce

Control the delay of a search in milliseconds with the debounceMs prop. Use it to prevent sending a query to the server before the user finishes typing.

Copy

Empty state

You can control what is being shown when no results are found.

renderEmptyState Renders a custom empty-state content when no options match the current search.

Copy

Common use case examples

Filtering the list

Use search as an action inside tables or cards to filter large data sets.

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'off'Sets the value of the native autocomplete attribute of the input.
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"none" | "standard" | "round" | "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.
closeOnSelectbooleantrueCloses DropdownLayout on option selection.
customDropdownContentReactNode—Accepts any content to render in the dropdown instead of the options list. Ignored when native is true.
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.
debounceMsnumber0Specifies the onChange debounce in milliseconds.
defaultValuestring | number—Defines the initial value of an input.
disabledboolean—Specifies whether input should be disabled or not.
disableEditingboolean—Restricts input editing.
dropDirectionUpboolean—Specifies whether the list opens upward. Aligns the list container to the bottom and positions the arrow for upward direction.
dropdownOffsetLeftstring'0'Sets the offset of the dropdown from the left.
dropdownWidthstringnullSets the width of the dropdown.
enterKeyHint"search" | "enter" | "done" | "go" | "next" | "previous" | "send"—Sets the label of the virtual keyboard's enter key on touch devices.
expandablebooleanfalseSpecifies whether to collapse input to search icon only. Once clicked, the icon expands to a full search input.
expandDirection"right" | "left"'right'Specifies the direction of expansion animation when expandable is true.
expandWidthstring | number'100%'Specifies the width of an input in an expanded state.
fixedFooterReactNode—A fixed footer to the list.
fixedHeaderReactNode—A fixed header to the list.
focusOnClearClickboolean—Specifies whether to focus the field when clear button is clicked.
focusOnOptionstring | number—Marks (not selects) and scrolls view to the option on opening the dropdown by option id.
focusOnSelectedOptionboolean—Scroll view to the selected option on opening the dropdown.
hasMoreboolean—Whether there are more items to be loaded.
hideStatusSuffixboolean—Specifies whether status suffix should be hidden.
highlightboolean—Mark in bold word parts based on search pattern.
idstring—Assigns a unique identifier for the root element.
inContainerboolean—Whether the <DropdownLayout/> is in a container component. If true, some styles such as shadows, positioning and padding are added to the component contentContainer.
infiniteScrollboolean—Set this prop for lazy loading of the dropdown layout items.
inputElementReactElement—Use a customized input component instead of the default
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.
itemHeight"big" | "small"'small'Controls the minimum height of options that aren't builder options.
listboxIdstring—Defines the id for the listbox.
listType"select" | "action"—Defines type of behavior applied in list.
loadMore(page: number) => void—A callback called when more items are requested to be rendered.
markedOptionstring | number | false | true—Sets the default hover behavior when: 1. false means no default 2. true means to hover the first selectable option 3. Any number/string represents the id of option to hover
maxnumber—Sets a maximum value of an input. Similar to html5 max attribute.
maxHeightPixelsstring | number—Set the max height of the dropdownLayout in pixels.
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.
minWidthPixelsstring | number—Set the min width of the dropdownLayout in pixels.
namestring—Reference element data when a form is submitted.
nativebooleanfalseIndicates whether to render using the native select element.
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.
onClickOutside(e: MouseEvent | TouchEvent) => void—Defines a callback function which is called when the user clicks or touches outside the list while it's visible.
onClose() => void—Callback function called whenever the user press the Escape keyboard.
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)
onDrillIn(option: DropdownLayoutValueOption) => void—Called when the user presses ArrowRight on a hovered option. Use to move focus into an interactive child element (e.g. an actions menu).
onDrillOut() => void—Called when the user navigates back from a drilled-in child element (e.g. via ArrowLeft or Escape). Use to restore focus to the trigger input.
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-.
onExpandTransitionEnd(collapsed: boolean) => void—Callback function that is called when the expandable input finishes expanding or collapsing.
onExpandTransitionStart(collapsed: boolean) => void—Callback function that is called when the expandable input starts expanding or collapsing.
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.
onManuallyInputManualInputFnSignature—A callback which is called when the user performs a Submit-Action. Submit-Action triggers are: "Enter", "Tab", [typing any defined delimiters], Paste action. `onManuallyInput(values: Array): void - The array of strings is the result of splitting the input value by the given delimiters
onMouseDownMouseEventHandler—Callback function called whenever the user clicks the dropdown layout.
onMouseEnterMouseEventHandler—Callback function called whenever the user entered with the mouse to the dropdown layout.
onMouseLeaveMouseEventHandler—Callback function called whenever the user exited with the mouse from the dropdown layout.
onOptionMarked(option: DropdownLayoutValueOption | null, optionElementId?: string | undefined) => void—Callback function called whenever an option becomes focused (hovered/active). Receives the relevant option object from the original props.options array.
onOptionsHide() => void—A callback which is called when options dropdown is hidden.
onOptionsNavigate(option: DropdownLayoutValueOption | null) => void—Callback function called whenever the user navigates to an option (via keyboard or mouse). Receives the relevant option object from the original props.options array, or null when navigation is cleared.
onOptionsShow() => void—A callback which is called when options dropdown is shown.
onPasteClipboardEventHandler<HTMLInputElement>—Defines a callback handler that is called when user pastes text from a clipboard (using a mouse or keyboard shortcut)
onSelect(option: DropdownLayoutValueOption, sameOptionWasPicked: boolean) => void—Defines a callback function which is called when the user selects an option from the list. When highlight is true, it receives the original option from options.
optionsDropdownLayoutOption[]—Array of objects: - id <string / number> required: the id of the option, should be unique. - value <function / string / node> required: can be a string, react element or a builder function. - disabled <bool> default value- false: whether this option is disabled or not - linkTo <string>: when provided, the option is an anchor to the given value - title <bool> default value- false deprecated: use listItemSectionBuilder to render a title instead. - overrideStyle <bool> default value- false deprecated: use overrideOptionStyle to override option styles instead. - overrideOptionStyle <bool> default value- false - when set to true, the option is responsible for its own styles. No styles are applied from the DropdownLayout itself. - label <string>: the string displayed within an input when the option is selected. This is used when using <DropdownLayout/> with an <Input/>.
overflow"visible" | "hidden" | "auto" | "scroll"—Set overflow of container.
patternstring—Sets a pattern that typed value must match to be valid (regex)
placeholderstring—Sets a placeholder message to display.
popoverPropsPopoverCommonProps—Accepts common popover props that are passed to the options dropdown popover.
predicate(option: DropdownLayoutValueOption) => boolean—Defines a custom function for options filtering.
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.
renderEmptyState(value: string | number | undefined) => ReactNode—Function which returns custom node shown when no options are available.
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.
scrollbar"fixed" | "overlay"—Controls which type of scrollbar to render.
scrollToOptionstring | number—Scrolls to the specified option when dropdown is opened without marking it.
selectedHighlightbooleantrueWhether the selected option is highlighted when the dropdown reopens.
selectedIdstring | number—The id of the selected option in the list.
showDrawerOnMobilebooleantrueControls whether to show drawer on mobile devices.
showOptionsIfEmptyInputbooleantrueControls whether to show options if input is empty.
size"small" | "tiny" | "medium" | "large"'medium'Controls the size of the input and its dropdown options. tiny and small inputs render small options, the rest render medium ones.
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.
valueParser(option: DropdownLayoutValueOption) => ReactNode | RenderOptionFn—Function that receives an option, and should return the value to be displayed.
visibleboolean—Should show or hide the component.
withArrowboolean—Displays an arrow on the list container while it's visible.
withSelectionboolean—

Testkit

No testkit for this component — it doesn't expose a unidriver testkit.

Changelog

  • 1.340.0 (2026-10-21) — 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.331.0 (2026-10-01) — maintenance release, no component-specific changes
  • 1.330.3 (2026-09-29) — maintenance release, no component-specific changes
  • 1.330.0 (2026-09-28) — maintenance release, no component-specific changes
  • 1.329.0 (2026-09-24) — 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.312.0 (2026-08-14) — maintenance release, no component-specific changes
  • 1.310.0 (2026-08-10) — 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.278.0 (2026-05-08) — maintenance release, no component-specific changes
  • 1.271.0 (2026-04-22) — 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.242.0 (2025-12-19) — maintenance release, no component-specific changes
  • 1.239.0 (2025-12-12) — fix: center icon in expandable mode across all themes (#15626)
  • 1.233.0 (2025-12-01) — feat: expandable transition callbacks (#15594)
  • 1.231.0 (2025-11-20) — maintenance release, no component-specific changes
  • 1.224.0 (2025-10-29) — feat: add expandDirection prop to control expansion direction (#15430)
  • 1.213.0 (2025-08-19) — maintenance release, no component-specific changes
  • 1.204.1 (2025-07-09) — fix: suffix keydown handling (#15049)
  • 1.190.0 (2025-05-22) — maintenance release, no component-specific changes
  • 1.186.0 (2025-05-05) — maintenance release, no component-specific changes
  • 1.185.0 (2025-04-30) — maintenance release, no component-specific changes
  • 1.138.1 (2024-10-30) — maintenance release, no component-specific changes
  • 1.131.0 (2024-10-10) — feat: tokenize (#14197)
  • 1.124.0 (2024-09-06) — maintenance release, no component-specific changes
  • 1.115.0 (2024-07-17) — maintenance release, no component-specific changes
  • 1.105.0 (2024-05-21) — feat: scrollbar prop (#13751)
  • 1.104.0 (2024-05-06) — feat: empty state (#13686)
  • 1.98.0 (2024-03-15) — fix: fix 'Expandable' With Large Size (#13460)
  • 1.92.1 (2024-02-05) — maintenance release, no component-specific changes

Last updated: 26 October 2026

Did this help?