Menu with Combobox
Combining Menu and Combobox to create a dropdown menu with a search field that can be used to filter menu items.
Paragraph
Heading
List
Quote
Classic
Code
Preformatted
Pullquote
Table
Verse
Image
Gallery
Audio
Cover
File
Media & Text
Video
Buttons
Columns
Group
More
Page Break
Separator
Archives
Calendar
Categories
Latest Comments
Latest Posts
Page List
RSS
Search
Shortcode
Social Icons
Tag Cloud
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
import * as Ariakit from "@ariakit/react";import { matchSorter } from "match-sorter";import { startTransition, useMemo, useState } from "react";import list from "./list.ts";import "./style.css";export default function Example() {const [searchValue, setSearchValue] = useState("");const matches = useMemo(() => {return matchSorter(list, searchValue, {baseSort: (a, b) => (a.index < b.index ? -1 : 1),});}, [searchValue]);return (startTransition(() => {setSearchValue(value);});}}>Add blockplaceholder="Search..."className="combobox"/>{matches.map((value) => (key={value}className="menu-item"/>))});}import * as Ariakit from "@ariakit/react";import { matchSorter } from "match-sorter";import { startTransition, useMemo, useState } from "react";import list from "./list.ts";import "./style.css";export default function Example() {const [searchValue, setSearchValue] = useState("");const matches = useMemo(() => {return matchSorter(list, searchValue, {baseSort: (a, b) => (a.index < b.index ? -1 : 1),});}, [searchValue]);return (startTransition(() => {setSearchValue(value);});}}>Add blockplaceholder="Search..."className="combobox"/>{matches.map((value) => (key={value}className="menu-item"/>))});}
Related examples
Submenu with ComboboxNesting Notion-style dropdown menus with search & autocomplete features by combining Menu with Combobox.
Select with ComboboxCombining Select and Combobox to create a dropdown with a search field that can be used to filter items.
Navigation MenubarUsing Menubar, Menu, and Portal to create an accessible, tabbable navigation menu widget with links and menu buttons that expand on hover and focus.
Combobox with TabsOrganizing Combobox with Tab components that support mouse, keyboard, and screen reader interactions. The UI remains responsive by using React.startTransition.
Command MenuCombining Dialog and Combobox to enable users to search a command list in a Raycast-style modal.