> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MenuSelect

> Lets users refine search results using a drop-down menu.

<Note>
  This is the **React InstantSearch v7** documentation.
  If you're upgrading from v6, see the [upgrade guide](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-v6-to-react-instantsearch-v7).
  If you were using React InstantSearch Hooks,
  this v7 documentation applies—just check for [necessary changes](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-hooks-to-react-instantsearch-v7).
  To continue using v6, you can find the [archived documentation](https://algolia.com/old-docs/deprecated/instantsearch/react/v6/api-reference/instantsearch/).
</Note>

## About this widget

The `<MenuSelect>` widget isn't part of React InstantSearch,
but you can make a custom version with the [`useMenu`](/doc/api-reference/widgets/menu/react#hook) Hook.

This widget allows a user to select a single value to refine inside a [`select`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) element.

## Examples

<CodeGroup>
  ```jsx JavaScript theme={"system"}
  import { useMenu } from "react-instantsearch";

  export function MenuSelect(props) {
    const { items, refine } = useMenu(props);
    const { value: selectedValue } = items.find((item) => item.isRefined) || {
      value: "",
    };

    return (
      <select
        value={selectedValue}
        onChange={(event) => {
          refine(event.target.value);
        }}
      >
        {items.map((item) => (
          <option value={item.value}>
            {item.label} ({item.count})
          </option>
        ))}
      </select>
    );
  }
  ```

  ```tsx TypeScript theme={"system"}
  import { useMenu, UseMenuProps } from "react-instantsearch";

  export function MenuSelect(props: UseMenuProps) {
    const { items, refine } = useMenu(props);
    const { value: selectedValue } = items.find((item) => item.isRefined) || {
      value: "",
    };

    return (
      <select
        value={selectedValue}
        onChange={(event) => {
          refine((event.target as HTMLSelectElement).value);
        }}
      >
        {items.map((item) => (
          <option value={item.value}>
            {item.label} ({item.count})
          </option>
        ))}
      </select>
    );
  }
  ```
</CodeGroup>
