> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Search Component

## Article: Search Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/form/search-component.md

## Article Content:

# Search

_Components/Form_

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

## Overview

```jsx
() => {
  const [text, setText] = React.useState('');

  const options = [
    { value: 'Option 1', id: 0 },
    { value: 'Option 2', id: 1 },
    { value: 'Option 3', id: 2 },
    { value: 'Option 4', id: 3 },
    { value: 'Option 5', id: 4 },
  ];

  return (
    <Box align="center">
      <Box direction="vertical" width="30%">
        <Search
          value={text}
          onChange={(e) => setText(e.target.value)}
          onClear={() => setText('')}
          options={options}
          onSelect={(option) => setText(String(option.value))}
        />
      </Box>
    </Box>
  );
};
```

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.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Search size="large" placeholder="Large" />
  <Search size="medium" placeholder="Medium" />
  <Search size="small" placeholder="Small" />
</StorybookComponents.Stack>;
```

#### 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.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Search border="round" placeholder="Search..." />
  <Search border="standard" placeholder="Search..." />
  <Search border="bottomLine" placeholder="Search..." />
  <Search border="none" placeholder="Search..." />
</StorybookComponents.Stack>;
```

#### 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.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Search status="loading" placeholder="Search..." />
  <Search status="error" placeholder="Search..." />
  <Search status="warning" placeholder="Search..." />
</StorybookComponents.Stack>;
```

#### 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/>`.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <FormField status="loading" statusMessage="This is a loading message.">
    <Search placeholder="See message below" />
  </FormField>
  <Search
    status="loading"
    placeholder="Hover on the loader"
    statusMessage="This is a loading message."
  />
</StorybookComponents.Stack>;
```

#### 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.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Search readOnly value="Read only" />
  <Search disabled value="Disabled" />
</StorybookComponents.Stack>;
```

#### 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.

```jsx
() => {
  const [inputText, setInputText] = React.useState(
    'Click clear button to erase this value',
  );

  return (
    <Search
      value={inputText}
      clearButton
      onChange={(e) => setInputText(e.target.value)}
      onClear={() => setInputText('')}
    />
  );
};
```

#### 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.

```jsx
() => {
  const [text, setText] = React.useState('');
  const options = [
    { value: 'Option 1', id: 0 },
    { value: 'Option 2', id: 1 },
    { value: 'Option 3', id: 2 },
    { value: 'Option 4', id: 3 },
    { value: 'Option 5', id: 4 },
  ];

  return (
    <Search
      value={text}
      onChange={(e) => setText(e.target.value)}
      onClear={() => setText('')}
      options={options}
      predicate={(option) => String(option.value).indexOf(text) !== -1}
    />
  );
};
```

#### 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.

```jsx
() => {
  const [text, setText] = React.useState('');
  const options = [
    { value: 'Option 1', id: 0 },
    { value: 'Option 2', id: 1 },
    { value: 'Option 3', id: 2 },
    { value: 'Option 4', id: 3 },
    { value: 'Option 5', id: 4 },
  ];

  return (
    <StorybookComponents.Stack>
      <Search
        value={text}
        clearButton={true}
        onChange={(e) => setText(e.target.value)}
        onClear={() => setText('')}
        options={options}
        maxHeightPixels="160px"
        minWidthPixels="300px"
        dropdownWidth="auto"
        popoverProps={{
          placement: 'bottom-start',
        }}
      />
    </StorybookComponents.Stack>
  );
};
```

#### 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

```jsx
() => (
  <Box gap="20px" direction="vertical">
    <Search expandable />
    <Search expandable expandWidth="400px" />
    <Search expandable expandWidth="400px" expandDirection="left" />
  </Box>
);
```

#### 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.

```jsx
() => {
  const [textInstant, setTextInstant] = React.useState('');
  const [textDelayed, setTextDelayed] = React.useState('');

  return (
    <StorybookComponents.Stack flexDirection="column">
      <StorybookComponents.Stack flexDirection="column" gap="12px">
        <Search
          placeholder="Search for instant results..."
          value={textInstant}
          onChange={(e) => setTextInstant(e.target.value)}
          onClear={() => setTextInstant('')}
        />
        <StorybookComponents.Stack>
          <Text size="tiny">Results for:</Text>
          <Text size="tiny" weight="bold" skin="primary">
            {textInstant}
          </Text>
        </StorybookComponents.Stack>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" gap="12px">
        <Search
          placeholder="Search for delayed results..."
          debounceMs={250}
          value={textDelayed}
          onChange={(e) => setTextDelayed(e.target.value)}
          onClear={() => setTextDelayed('')}
        />
        <StorybookComponents.Stack>
          <Text size="tiny">Results for:</Text>
          <Text size="tiny" weight="bold" skin="primary">
            {textDelayed}
          </Text>
        </StorybookComponents.Stack>
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### 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.

```jsx
() => {
  const [value, setValue] = React.useState('');

  const options = [
    { id: 1, value: 'Dashboard' },
    { id: 2, value: 'Bookings' },
    { id: 3, value: 'Store orders' },
    { id: 4, value: 'Analytics' },
  ];

  return (
    <Box gap="20px" direction="vertical">
      <Search
        dataHook="search-render-empty-state"
        value={value}
        options={options}
        onChange={(event) => setValue(event.target.value)}
        placeholder="Search pages"
        renderEmptyState={(searchValue) => (
          <Box padding="12px" direction="vertical" gap="4px">
            <Text size="small" weight="bold">
              No results found
            </Text>
            <Text size="small" secondary>
              No matches for "{searchValue}".
            </Text>
          </Box>
        )}
      />
    </Box>
  );
};
```

### Common use case examples

#### Filtering the list

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

```jsx
() => {
  const [filterBy, setFilterBy] = React.useState('');
  const [activeSearch, setActiveSearch] = React.useState('');

  const records = [
    {
      name: 'Red slippers',
      sku: 25232564,
      status: 'In stock',
      price: '$14.00',
    },
    { name: 'Velvet hat', sku: 35246432, status: 'In stock', price: '$29.00' },
    {
      name: 'Silver jeans',
      sku: 4864310,
      status: 'Out of stock',
      price: '$69.00',
    },
    {
      name: 'Orange socks',
      sku: 125156422,
      status: 'In stock',
      price: '$7.00',
    },
  ];

  const columns = [
    { title: 'Name', render: (row) => row.name },
    { title: 'SKU', render: (row) => row.sku },
    { title: 'Status', render: (row) => row.status },
    { title: 'Price', render: (row) => row.price },
  ];

  const filterOptions = [
    { id: '', value: 'All statuses' },
    { id: 'In stock', value: 'In stock' },
    { id: 'Out of stock', value: 'Out of stock' },
  ];

  const getFilteredData = () =>
    records.filter(({ name, sku, status, price }) => {
      if (filterBy && status !== filterBy) {
        return false;
      }

      const searchData = [name, sku, status, price].join(' ').toLowerCase();
      const searchQuery = activeSearch.trim().toLowerCase();
      if (searchQuery && searchData.indexOf(searchQuery) === -1) {
        return false;
      }

      return true;
    });

  const MainToolbar = () => {
    return (
      <TableToolbar>
        <TableToolbar.ItemGroup position="start">
          <TableToolbar.Item>
            <TableToolbar.Title>Products</TableToolbar.Title>
          </TableToolbar.Item>
        </TableToolbar.ItemGroup>
        <TableToolbar.ItemGroup position="end">
          <TableToolbar.Item>
            <TableToolbar.Label>
              Filter by
              <Box width="175">
                <Dropdown
                  size="small"
                  options={filterOptions}
                  selectedId={filterBy}
                  border="round"
                  onSelect={({ id }) => setFilterBy(String(id))}
                />
              </Box>
            </TableToolbar.Label>
          </TableToolbar.Item>
          <TableToolbar.Item>
            <Box width="200">
              <Search
                size="small"
                value={activeSearch}
                onChange={(e) => setActiveSearch(e.target.value)}
                onClear={() => setActiveSearch('')}
              />
            </Box>
          </TableToolbar.Item>
        </TableToolbar.ItemGroup>
      </TableToolbar>
    );
  };

  const ActionsToolbar = ({ selectedCount, getSelectedIds }) => (
    <TableToolbar>
      <TableToolbar.ItemGroup position="start">
        <TableToolbar.Item>
          <TableToolbar.SelectedCount>{`${selectedCount} Selected`}</TableToolbar.SelectedCount>
        </TableToolbar.Item>
      </TableToolbar.ItemGroup>
      <TableToolbar.ItemGroup position="end">
        <TableToolbar.Item layout="button">
          <Button skin="light" prefixIcon={<Icons.Upload />}>
            Export
          </Button>
        </TableToolbar.Item>
        <TableToolbar.Item layout="button">
          <Button skin="light" prefixIcon={<Icons.Duplicate />}>
            Duplicate
          </Button>
        </TableToolbar.Item>
        <TableToolbar.Item layout="button">
          <Button skin="light" prefixIcon={<Icons.Edit />}>
            Edit
          </Button>
        </TableToolbar.Item>
        <TableToolbar.Divider />
        <TableToolbar.Item>
          <Search
            expandable
            value={activeSearch}
            onChange={(e) => setActiveSearch(e.target.value)}
          />
        </TableToolbar.Item>
      </TableToolbar.ItemGroup>
    </TableToolbar>
  );

  return (
    <Card>
      <Table showSelection data={getFilteredData()} columns={columns}>
        <Table.ToolbarContainer>
          {(selectionContext) =>
            selectionContext.selectedCount === 0
              ? MainToolbar()
              : ActionsToolbar({ ...selectionContext })
          }
        </Table.ToolbarContainer>
        <Table.Content />
        {!records.length && (
          <Table.EmptyState
            subtitle={
              <Text>
                {'There are no search results matching '}
                <Text weight="normal">{`"${activeSearch}"`}</Text>
              </Text>
            }
          />
        )}
      </Table>
    </Card>
  );
};
```

## Code

```jsx
import { Search } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `ariaControls` | `string` | — | Associate a control with the regions that it controls. |
| `ariaDescribedby` | `string` | — | 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. |
| `ariaLabel` | `string` | — | Define a string that labels the current element in case where a text label isn't visible on the screen. |
| `ariaRoledescription` | `string` | — | Sets the `aria-roledescription` attribute of the `<input>` element, giving assistive technologies a readable description of its role. |
| `autocomplete` | `string` | `'off'` | Sets the value of the native `autocomplete` attribute of the input. |
| `autoFocus` | `boolean` | — | Focus the element on mount (standard React input autoFocus) |
| `autoSelect` | `boolean` | — | Automatically selects the entire input text. |
| `backgroundColor` | `string` | — | Sets the background color of the input. Accepts any CSS color value. |
| `border` | `"none" \| "standard" \| "round" \| "bottomLine"` | — | Control the border style of input. |
| `children` | `ReactNode` | — |  |
| `clearButton` | `boolean` | — | Displays clear button (X) on a non-empty input. |
| `clearButtonAriaLabel` | `string` | — | Aria label for the clear button. |
| `clearButtonTooltipContent` | `ReactNode` | — | When provided, hovering displays a tooltip with this content. |
| `clearButtonTooltipProps` | `TooltipCommonProps` | — | Clear button tooltip props. |
| `closeOnSelect` | `boolean` | `true` | Closes DropdownLayout on option selection. |
| `customDropdownContent` | `ReactNode` | — | Accepts any content to render in the dropdown instead of the options list. Ignored when `native` is `true`. |
| `customInput` | `ReactNode \| Function` | — | Render a custom input instead of the default html input tag. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `debounceMs` | `number` | `0` | Specifies the `onChange` debounce in milliseconds. |
| `defaultValue` | `string \| number` | — | Defines the initial value of an input. |
| `disabled` | `boolean` | — | Specifies whether input should be disabled or not. |
| `disableEditing` | `boolean` | — | Restricts input editing. |
| `dropDirectionUp` | `boolean` | — | Specifies whether the list opens upward. Aligns the list container to the bottom and positions the arrow for upward direction. |
| `dropdownOffsetLeft` | `string` | `'0'` | Sets the offset of the dropdown from the left. |
| `dropdownWidth` | `string` | `null` | Sets 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. |
| `expandable` | `boolean` | `false` | Specifies 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. |
| `expandWidth` | `string \| number` | `'100%'` | Specifies the width of an input in an  expanded state. |
| `fixedFooter` | `ReactNode` | — | A fixed footer to the list. |
| `fixedHeader` | `ReactNode` | — | A fixed header to the list. |
| `focusOnClearClick` | `boolean` | — | Specifies whether to focus the field when clear button is clicked. |
| `focusOnOption` | `string \| number` | — | Marks (not selects) and scrolls view to the option on opening the dropdown by option id. |
| `focusOnSelectedOption` | `boolean` | — | Scroll view to the selected option on opening the dropdown. |
| `hasMore` | `boolean` | — | Whether there are more items to be loaded. |
| `hideStatusSuffix` | `boolean` | — | Specifies whether status suffix should be hidden. |
| `highlight` | `boolean` | — | Mark in bold word parts based on search pattern. |
| `id` | `string` | — | Assigns a unique identifier for the root element. |
| `inContainer` | `boolean` | — | Whether the `<DropdownLayout/>` is in a container component. If `true`, some styles such as shadows, positioning and padding are added to the component contentContainer. |
| `infiniteScroll` | `boolean` | — | Set this prop for lazy loading of the dropdown layout items. |
| `inputElement` | `ReactElement` | — | Use a customized input component instead of the default |
| `inputmode` | `string` | — | Sets the value of the native `inputmode` attribute, which tells mobile browsers which on-screen keyboard to show, for example `numeric` or `email`. |
| `inputRef` | `null \| (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. |
| `listboxId` | `string` | — | 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. |
| `markedOption` | `string \| 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 |
| `max` | `number` | — | Sets a maximum value of an input. Similar to html5 max attribute. |
| `maxHeightPixels` | `string \| number` | — | Set the max height of the dropdownLayout in pixels. |
| `maxLength` | `number` | — | Sets the maximum number of characters that can be inserted to a field. |
| `menuArrow` | `boolean` | — | Specifies whether input should have a dropdown menu arrow on the right side. |
| `min` | `number` | — | Sets a minimum value of an input. Similar to HTML5 min attribute. |
| `minWidthPixels` | `string \| number` | — | Set the min width of the dropdownLayout in pixels. |
| `name` | `string` | — | Reference element data when a form is submitted. |
| `native` | `boolean` | `false` | Indicates whether to render using the native select element. |
| `noLeftBorderRadius` | `boolean` | — | Specifies whether input shouldn't have rounded corners on its left. |
| `noRightBorderRadius` | `boolean` | — | Specifies whether input shouldn't have rounded corners on its right. |
| `onBlur` | `FocusEventHandler` | — | Defines a standard input onBlur callback. |
| `onChange` | `ChangeEventHandler` | — | 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. |
| `onCopy` | `ClipboardEventHandler<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. |
| `onEnterPressed` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a callback handler that is called when the user presses -enter-. |
| `onEscapePressed` | `KeyboardEventHandler<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. |
| `onFocus` | `FocusEventHandler` | — | Defines a standard input onFocus callback. |
| `onInputClicked` | `MouseEventHandler` | — | Defines a standard input onClick callback. |
| `onKeyDown` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a standard input onKeyDown callback. |
| `onKeyUp` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a standard input onKeyUp callback. |
| `onManuallyInput` | `ManualInputFnSignature` | — | 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<string>): void - The array of strings is the result of splitting the input value by the given delimiters |
| `onMouseDown` | `MouseEventHandler` | — | Callback function called whenever the user clicks the dropdown layout. |
| `onMouseEnter` | `MouseEventHandler` | — | Callback function called whenever the user entered with the mouse to the dropdown layout. |
| `onMouseLeave` | `MouseEventHandler` | — | 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. |
| `onPaste` | `ClipboardEventHandler<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`. |
| `options` | `DropdownLayoutOption[]` | — | 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. |
| `pattern` | `string` | — | Sets a pattern that typed value must match to be valid (regex) |
| `placeholder` | `string` | — | Sets a placeholder message to display. |
| `popoverProps` | `PopoverCommonProps` | — | Accepts common popover props that are passed to the options dropdown popover. |
| `predicate` | `(option: DropdownLayoutValueOption) => boolean` | — | Defines a custom function for options filtering. |
| `prefix` | `ReactNode` | — | Pass a component you want to show as the prefix of the input, e.g., text, icon. |
| `readOnly` | `boolean` | — | Specifies whether input is read only. |
| `renderEmptyState` | `(value: string \| number \| undefined) => ReactNode` | — | Function which returns custom node shown when no options are available. |
| `required` | `boolean` | — | Specifies whether input is mandatory. |
| `role` | `string` | — | Specifies the role of the input element for accessibility. |
| `rtl` | `boolean` | — | Specifies text direction. If true, the text is displayed from right to left. |
| `scrollbar` | `"fixed" \| "overlay"` | — | Controls which type of scrollbar to render. |
| `scrollToOption` | `string \| number` | — | Scrolls to the specified option when dropdown is opened without marking it. |
| `selectedHighlight` | `boolean` | `true` | Whether the selected option is highlighted when the dropdown reopens. |
| `selectedId` | `string \| number` | — | The id of the selected option in the list. |
| `showDrawerOnMobile` | `boolean` | `true` | Controls whether to show drawer on mobile devices. |
| `showOptionsIfEmptyInput` | `boolean` | `true` | Controls 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. |
| `statusMessage` | `ReactNode` | — | Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed. |
| `statusMessageTooltipProps` | `TooltipCommonProps` | — | Status message tooltip props. |
| `step` | `number` | — | Specifies the interval between number values. |
| `suffix` | `ReactNode` | — | Pass a component you want to show as the suffix of the input, e.g., text, icon. |
| `tabIndex` | `number` | — | 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. |
| `type` | `string` | — | Specifies the type of `<input/>` element to display. Default is text. |
| `value` | `string \| 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. |
| `visible` | `boolean` | — | Should show or hide the component. |
| `withArrow` | `boolean` | — | Displays an arrow on the list container while it's visible. |
| `withSelection` | `boolean` | — |  |

## 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](invalid-url))
- **1.233.0** (2025-12-01) — feat: expandable transition callbacks ([#15594](invalid-url))
- **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](invalid-url))
- **1.213.0** (2025-08-19) — maintenance release, no component-specific changes
- **1.204.1** (2025-07-09) — fix: suffix keydown handling ([#15049](invalid-url))
- **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](invalid-url))
- **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](invalid-url))
- **1.104.0** (2024-05-06) — feat: empty state ([#13686](invalid-url))
- **1.98.0** (2024-03-15) — fix: fix 'Expandable' With Large Size ([#13460](invalid-url))
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes