{ "name": "combobox", "snippet": null, "examples": [ { "name": "combobox-autohighlight", "content": "\"use client\"\nexport const ComboboxAutoHighlight = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n inputBehavior=\"autohighlight\"\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-basic", "content": "\"use client\"\nexport const ComboboxBasic = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-color-picker", "content": "\"use client\"\nexport const ComboboxColorPicker = () => {\n const [selectedColor, setSelectedColor] = useState(null)\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: colors,\n filter: contains,\n itemToValue: (item) => item.id,\n itemToString: (item) => item.name,\n })\n\n const handleValueChange = (details: Combobox.ValueChangeDetails) => {\n setSelectedColor(details.items[0] || null)\n }\n\n const handleInputValueChange = (\n details: Combobox.InputValueChangeDetails,\n ) => {\n filter(details.inputValue)\n }\n\n return (\n \n Select Color\n \n \n \n \n \n \n \n \n {selectedColor && }\n \n\n \n \n Color\n {collection.items.map((color) => (\n \n \n \n \n {color.name}\n \n {color.value}\n \n \n \n \n \n ))}\n \n \n \n )\n}\n\ninterface ColorItem {\n id: string\n name: string\n value: string\n}\n\nconst colors: ColorItem[] = [\n { id: \"red\", name: \"Red\", value: \"#EF4444\" },\n { id: \"blue\", name: \"Blue\", value: \"#3B82F6\" },\n { id: \"green\", name: \"Green\", value: \"#10B981\" },\n { id: \"purple\", name: \"Purple\", value: \"#8B5CF6\" },\n { id: \"yellow\", name: \"Yellow\", value: \"#F59E0B\" },\n { id: \"pink\", name: \"Pink\", value: \"#EC4899\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n ColorSwatch,\n Combobox,\n HStack,\n Stack,\n Text,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useState } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-controlled", "content": "\"use client\"\nexport const ComboboxControlled = () => {\n const [value, setValue] = useState([])\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n value={value}\n onValueChange={(e) => setValue(e.value)}\n width=\"320px\"\n >\n \n Selected:\n \n \n {(v) => {v}}\n \n \n \n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Badge,\n Combobox,\n For,\n HStack,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useState } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-in-popover", "content": "\"use client\"\nexport const ComboboxInPopover = () => {\n return (\n \n \n \n \n \n \n \n Select framework\n \n \n \n \n \n \n \n )\n}\n\nconst ComboboxDemo = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n >\n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Button,\n Combobox,\n Popover,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-min-character", "content": "\"use client\"\nexport const ComboboxMinCharacter = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n openOnChange={(e) => e.inputValue.length > 2}\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-open-controlled", "content": "\"use client\"\nexport const ComboboxOpenControlled = () => {\n const [open, setOpen] = useState(false)\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n open={open}\n onOpenChange={(e) => setOpen(e.open)}\n >\n Combobox is {open ? \"open\" : \"closed\"}\n\n \n \n \n \n \n \n \n\n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useState } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-open-on-click", "content": "\"use client\"\nexport const ComboboxOpenOnClick = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n openOnClick\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-rehydrate-value", "content": "\"use client\"\nexport const ComboboxRehydrateValue = () => {\n const [inputValue, setInputValue] = useState(\"\")\n\n const { collection, set } = useListCollection({\n initialItems: [],\n itemToString: (item) => item.name,\n itemToValue: (item) => item.name,\n })\n\n const combobox = useCombobox({\n collection,\n defaultValue: [\"C-3PO\"],\n placeholder: \"Example: Dexter\",\n inputValue,\n onInputValueChange: (e) => setInputValue(e.inputValue),\n })\n\n const state = useAsync(async () => {\n const response = await fetch(\n `https://swapi.py4e.com/api/people/?search=${inputValue}`,\n )\n const data = await response.json()\n set(data.results)\n }, [inputValue, set])\n\n // Rehydrate the value\n const hydrated = useRef(false)\n if (combobox.value.length && collection.size && !hydrated.current) {\n combobox.syncSelectedItems()\n hydrated.current = true\n }\n\n return (\n \n Search Star Wars Characters\n\n \n \n \n\n \n \n \n {state.loading ? (\n \n \n Loading...\n \n ) : state.error ? (\n \n {state.error.message}\n \n ) : (\n No items}\n >\n {(item) => (\n \n \n {item.name}\n \n {item.height}cm / {item.mass}kg\n \n \n \n \n )}\n \n )}\n \n \n \n \n )\n}\n\ninterface Character {\n name: string\n height: string\n mass: string\n created: string\n edited: string\n url: string\n}\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n For,\n HStack,\n Portal,\n Span,\n Spinner,\n useCombobox,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useRef, useState } from \"react\"", "import { useAsync } from \"react-use\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "react-use" ] }, { "name": "combobox-virtualized", "content": "\"use client\"\nexport const ComboboxVirtualized = () => {\n const contentRef = useRef(null)\n\n const { startsWith } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter, reset } = useListCollection({\n initialItems: items,\n filter: startsWith,\n })\n\n const virtualizer = useVirtualizer({\n count: collection.size,\n getScrollElement: () => contentRef.current,\n estimateSize: () => 28,\n overscan: 10,\n scrollPaddingEnd: 32,\n })\n\n const handleScrollToIndexFn = (details: { index: number }) => {\n flushSync(() => {\n virtualizer.scrollToIndex(details.index, {\n align: \"center\",\n behavior: \"auto\",\n })\n })\n }\n\n return (\n filter(e.inputValue)}\n scrollToIndexFn={handleScrollToIndexFn}\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n \n {virtualizer.getVirtualItems().map((virtualItem) => {\n const item = collection.items[virtualItem.index]\n return (\n \n \n \n {item.emoji}\n \n {item.label}\n \n \n \n )\n })}\n \n \n \n \n \n )\n}\n\nexport const items = [\n { value: \"AD\", label: \"Andorra\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฉ\" },\n { value: \"AE\", label: \"United Arab Emirates\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ช\" },\n { value: \"AF\", label: \"Afghanistan\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ซ\" },\n { value: \"AG\", label: \"Antigua and Barbuda\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฌ\" },\n { value: \"AI\", label: \"Anguilla\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฎ\" },\n { value: \"AL\", label: \"Albania\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฑ\" },\n { value: \"AM\", label: \"Armenia\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฒ\" },\n { value: \"AO\", label: \"Angola\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ด\" },\n { value: \"AQ\", label: \"Antarctica\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ถ\" },\n { value: \"AR\", label: \"Argentina\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ท\" },\n { value: \"AS\", label: \"American Samoa\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ธ\" },\n { value: \"AT\", label: \"Austria\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡น\" },\n { value: \"AU\", label: \"Australia\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡บ\" },\n { value: \"AW\", label: \"Aruba\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ผ\" },\n { value: \"AX\", label: \"ร…land Islands\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฝ\" },\n { value: \"AZ\", label: \"Azerbaijan\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฟ\" },\n { value: \"BA\", label: \"Bosnia and Herzegovina\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฆ\" },\n { value: \"BB\", label: \"Barbados\", emoji: \"๐Ÿ‡ง๐Ÿ‡ง\" },\n { value: \"BD\", label: \"Bangladesh\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฉ\" },\n { value: \"BE\", label: \"Belgium\", emoji: \"๐Ÿ‡ง๐Ÿ‡ช\" },\n { value: \"BF\", label: \"Burkina Faso\", emoji: \"๐Ÿ‡ง๐Ÿ‡ซ\" },\n { value: \"BG\", label: \"Bulgaria\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฌ\" },\n { value: \"BH\", label: \"Bahrain\", emoji: \"๐Ÿ‡ง๐Ÿ‡ญ\" },\n { value: \"BI\", label: \"Burundi\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฎ\" },\n { value: \"BJ\", label: \"Benin\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฏ\" },\n { value: \"BL\", label: \"Saint Barthรฉlemy\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฑ\" },\n { value: \"BM\", label: \"Bermuda\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฒ\" },\n { value: \"BN\", label: \"Brunei Darussalam\", emoji: \"๐Ÿ‡ง๐Ÿ‡ณ\" },\n { value: \"BO\", label: \"Bolivia, Plurinational State of\", emoji: \"๐Ÿ‡ง๐Ÿ‡ด\" },\n { value: \"BQ\", label: \"Bonaire, Sint Eustatius and Saba\", emoji: \"๐Ÿ‡ง๐Ÿ‡ถ\" },\n { value: \"BR\", label: \"Brazil\", emoji: \"๐Ÿ‡ง๐Ÿ‡ท\" },\n { value: \"BS\", label: \"Bahamas\", emoji: \"๐Ÿ‡ง๐Ÿ‡ธ\" },\n { value: \"BT\", label: \"Bhutan\", emoji: \"๐Ÿ‡ง๐Ÿ‡น\" },\n { value: \"BV\", label: \"Bouvet Island\", emoji: \"๐Ÿ‡ง๐Ÿ‡ป\" },\n { value: \"BW\", label: \"Botswana\", emoji: \"๐Ÿ‡ง๐Ÿ‡ผ\" },\n { value: \"BY\", label: \"Belarus\", emoji: \"๐Ÿ‡ง๐Ÿ‡พ\" },\n { value: \"BZ\", label: \"Belize\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฟ\" },\n { value: \"CA\", label: \"Canada\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฆ\" },\n { value: \"CC\", label: \"Cocos (Keeling) Islands\", emoji: \"๐Ÿ‡จ๐Ÿ‡จ\" },\n { value: \"CD\", label: \"Congo, Democratic Republic of the\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฉ\" },\n { value: \"CF\", label: \"Central African Republic\", emoji: \"๐Ÿ‡จ๐Ÿ‡ซ\" },\n { value: \"CG\", label: \"Congo\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฌ\" },\n { value: \"CH\", label: \"Switzerland\", emoji: \"๐Ÿ‡จ๐Ÿ‡ญ\" },\n { value: \"CI\", label: \"Cรดte d'Ivoire\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฎ\" },\n { value: \"CK\", label: \"Cook Islands\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฐ\" },\n { value: \"CL\", label: \"Chile\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฑ\" },\n { value: \"CM\", label: \"Cameroon\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฒ\" },\n { value: \"CN\", label: \"China\", emoji: \"๐Ÿ‡จ๐Ÿ‡ณ\" },\n { value: \"CO\", label: \"Colombia\", emoji: \"๐Ÿ‡จ๐Ÿ‡ด\" },\n { value: \"CR\", label: \"Costa Rica\", emoji: \"๐Ÿ‡จ๐Ÿ‡ท\" },\n { value: \"CU\", label: \"Cuba\", emoji: \"๐Ÿ‡จ๐Ÿ‡บ\" },\n { value: \"CV\", label: \"Cabo Verde\", emoji: \"๐Ÿ‡จ๐Ÿ‡ป\" },\n { value: \"CW\", label: \"Curaรงao\", emoji: \"๐Ÿ‡จ๐Ÿ‡ผ\" },\n { value: \"CX\", label: \"Christmas Island\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฝ\" },\n { value: \"CY\", label: \"Cyprus\", emoji: \"๐Ÿ‡จ๐Ÿ‡พ\" },\n { value: \"CZ\", label: \"Czechia\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฟ\" },\n { value: \"DE\", label: \"Germany\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ช\" },\n { value: \"DJ\", label: \"Djibouti\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฏ\" },\n { value: \"DK\", label: \"Denmark\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฐ\" },\n { value: \"DM\", label: \"Dominica\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฒ\" },\n { value: \"DO\", label: \"Dominican Republic\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ด\" },\n { value: \"DZ\", label: \"Algeria\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฟ\" },\n { value: \"EC\", label: \"Ecuador\", emoji: \"๐Ÿ‡ช๐Ÿ‡จ\" },\n { value: \"EE\", label: \"Estonia\", emoji: \"๐Ÿ‡ช๐Ÿ‡ช\" },\n { value: \"EG\", label: \"Egypt\", emoji: \"๐Ÿ‡ช๐Ÿ‡ฌ\" },\n { value: \"EH\", label: \"Western Sahara\", emoji: \"๐Ÿ‡ช๐Ÿ‡ญ\" },\n { value: \"ER\", label: \"Eritrea\", emoji: \"๐Ÿ‡ช๐Ÿ‡ท\" },\n { value: \"ES\", label: \"Spain\", emoji: \"๐Ÿ‡ช๐Ÿ‡ธ\" },\n { value: \"ET\", label: \"Ethiopia\", emoji: \"๐Ÿ‡ช๐Ÿ‡น\" },\n { value: \"FI\", label: \"Finland\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฎ\" },\n { value: \"FJ\", label: \"Fiji\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฏ\" },\n { value: \"FK\", label: \"Falkland Islands (Malvinas)\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฐ\" },\n { value: \"FM\", label: \"Micronesia, Federated States of\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฒ\" },\n { value: \"FO\", label: \"Faroe Islands\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ด\" },\n { value: \"FR\", label: \"France\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ท\" },\n { value: \"GA\", label: \"Gabon\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฆ\" },\n {\n value: \"GB\",\n label: \"United Kingdom of Great Britain and Northern Ireland\",\n emoji: \"๐Ÿ‡ฌ๐Ÿ‡ง\",\n },\n { value: \"GD\", label: \"Grenada\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฉ\" },\n { value: \"GE\", label: \"Georgia\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ช\" },\n { value: \"GF\", label: \"French Guiana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ซ\" },\n { value: \"GG\", label: \"Guernsey\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฌ\" },\n { value: \"GH\", label: \"Ghana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ญ\" },\n { value: \"GI\", label: \"Gibraltar\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฎ\" },\n { value: \"GL\", label: \"Greenland\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฑ\" },\n { value: \"GM\", label: \"Gambia\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฒ\" },\n { value: \"GN\", label: \"Guinea\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ณ\" },\n { value: \"GP\", label: \"Guadeloupe\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ต\" },\n { value: \"GQ\", label: \"Equatorial Guinea\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ถ\" },\n { value: \"GR\", label: \"Greece\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ท\" },\n {\n value: \"GS\",\n label: \"South Georgia and the South Sandwich Islands\",\n emoji: \"๐Ÿ‡ฌ๐Ÿ‡ธ\",\n },\n { value: \"GT\", label: \"Guatemala\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡น\" },\n { value: \"GU\", label: \"Guam\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡บ\" },\n { value: \"GW\", label: \"Guinea-Bissau\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ผ\" },\n { value: \"GY\", label: \"Guyana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡พ\" },\n { value: \"HK\", label: \"Hong Kong\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ฐ\" },\n { value: \"HM\", label: \"Heard Island and McDonald Islands\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ฒ\" },\n { value: \"HN\", label: \"Honduras\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ณ\" },\n { value: \"HR\", label: \"Croatia\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ท\" },\n { value: \"HT\", label: \"Haiti\", emoji: \"๐Ÿ‡ญ๐Ÿ‡น\" },\n { value: \"HU\", label: \"Hungary\", emoji: \"๐Ÿ‡ญ๐Ÿ‡บ\" },\n { value: \"ID\", label: \"Indonesia\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฉ\" },\n { value: \"IE\", label: \"Ireland\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ช\" },\n { value: \"IL\", label: \"Israel\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฑ\" },\n { value: \"IM\", label: \"Isle of Man\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฒ\" },\n { value: \"IN\", label: \"India\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ณ\" },\n { value: \"IO\", label: \"British Indian Ocean Territory\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ด\" },\n { value: \"IQ\", label: \"Iraq\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ถ\" },\n { value: \"IR\", label: \"Iran, Islamic Republic of\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ท\" },\n { value: \"IS\", label: \"Iceland\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ธ\" },\n { value: \"IT\", label: \"Italy\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡น\" },\n { value: \"JE\", label: \"Jersey\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ช\" },\n { value: \"JM\", label: \"Jamaica\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ฒ\" },\n { value: \"JO\", label: \"Jordan\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ด\" },\n { value: \"JP\", label: \"Japan\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ต\" },\n { value: \"KE\", label: \"Kenya\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ช\" },\n { value: \"KG\", label: \"Kyrgyzstan\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฌ\" },\n { value: \"KH\", label: \"Cambodia\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ญ\" },\n { value: \"KI\", label: \"Kiribati\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฎ\" },\n { value: \"KM\", label: \"Comoros\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฒ\" },\n { value: \"KN\", label: \"Saint Kitts and Nevis\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ณ\" },\n { value: \"KP\", label: \"Korea, Democratic People's Republic of\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ต\" },\n { value: \"KR\", label: \"Korea, Republic of\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ท\" },\n { value: \"KW\", label: \"Kuwait\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ผ\" },\n { value: \"KY\", label: \"Cayman Islands\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡พ\" },\n { value: \"KZ\", label: \"Kazakhstan\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฟ\" },\n { value: \"LA\", label: \"Lao People's Democratic Republic\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฆ\" },\n { value: \"LB\", label: \"Lebanon\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ง\" },\n { value: \"LC\", label: \"Saint Lucia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡จ\" },\n { value: \"LI\", label: \"Liechtenstein\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฎ\" },\n { value: \"LK\", label: \"Sri Lanka\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฐ\" },\n { value: \"LR\", label: \"Liberia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ท\" },\n { value: \"LS\", label: \"Lesotho\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ธ\" },\n { value: \"LT\", label: \"Lithuania\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡น\" },\n { value: \"LU\", label: \"Luxembourg\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡บ\" },\n { value: \"LV\", label: \"Latvia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ป\" },\n { value: \"LY\", label: \"Libya\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡พ\" },\n { value: \"MA\", label: \"Morocco\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฆ\" },\n { value: \"MC\", label: \"Monaco\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡จ\" },\n { value: \"MD\", label: \"Moldova, Republic of\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฉ\" },\n { value: \"ME\", label: \"Montenegro\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ช\" },\n { value: \"MF\", label: \"Saint Martin, (French part)\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ซ\" },\n { value: \"MG\", label: \"Madagascar\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฌ\" },\n { value: \"MH\", label: \"Marshall Islands\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ญ\" },\n { value: \"MK\", label: \"North Macedonia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฐ\" },\n { value: \"ML\", label: \"Mali\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฑ\" },\n { value: \"MM\", label: \"Myanmar\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฒ\" },\n { value: \"MN\", label: \"Mongolia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ณ\" },\n { value: \"MO\", label: \"Macao\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ด\" },\n { value: \"MP\", label: \"Northern Mariana Islands\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ต\" },\n { value: \"MQ\", label: \"Martinique\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ถ\" },\n { value: \"MR\", label: \"Mauritania\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ท\" },\n { value: \"MS\", label: \"Montserrat\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ธ\" },\n { value: \"MT\", label: \"Malta\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡น\" },\n { value: \"MU\", label: \"Mauritius\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡บ\" },\n { value: \"MV\", label: \"Maldives\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ป\" },\n { value: \"MW\", label: \"Malawi\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ผ\" },\n { value: \"MX\", label: \"Mexico\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฝ\" },\n { value: \"MY\", label: \"Malaysia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡พ\" },\n { value: \"MZ\", label: \"Mozambique\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฟ\" },\n { value: \"NA\", label: \"Namibia\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฆ\" },\n { value: \"NC\", label: \"New Caledonia\", emoji: \"๐Ÿ‡ณ๐Ÿ‡จ\" },\n { value: \"NE\", label: \"Niger\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ช\" },\n { value: \"NF\", label: \"Norfolk Island\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ซ\" },\n { value: \"NG\", label: \"Nigeria\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฌ\" },\n { value: \"NI\", label: \"Nicaragua\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฎ\" },\n { value: \"NL\", label: \"Netherlands\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฑ\" },\n { value: \"NO\", label: \"Norway\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ด\" },\n { value: \"NP\", label: \"Nepal\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ต\" },\n { value: \"NR\", label: \"Nauru\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ท\" },\n { value: \"NU\", label: \"Niue\", emoji: \"๐Ÿ‡ณ๐Ÿ‡บ\" },\n { value: \"NZ\", label: \"New Zealand\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฟ\" },\n { value: \"OM\", label: \"Oman\", emoji: \"๐Ÿ‡ด๐Ÿ‡ฒ\" },\n { value: \"PA\", label: \"Panama\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฆ\" },\n { value: \"PE\", label: \"Peru\", emoji: \"๐Ÿ‡ต๐Ÿ‡ช\" },\n { value: \"PF\", label: \"French Polynesia\", emoji: \"๐Ÿ‡ต๐Ÿ‡ซ\" },\n { value: \"PG\", label: \"Papua New Guinea\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฌ\" },\n { value: \"PH\", label: \"Philippines\", emoji: \"๐Ÿ‡ต๐Ÿ‡ญ\" },\n { value: \"PK\", label: \"Pakistan\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฐ\" },\n { value: \"PL\", label: \"Poland\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฑ\" },\n { value: \"PM\", label: \"Saint Pierre and Miquelon\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฒ\" },\n { value: \"PN\", label: \"Pitcairn\", emoji: \"๐Ÿ‡ต๐Ÿ‡ณ\" },\n { value: \"PR\", label: \"Puerto Rico\", emoji: \"๐Ÿ‡ต๐Ÿ‡ท\" },\n { value: \"PS\", label: \"Palestine, State of\", emoji: \"๐Ÿ‡ต๐Ÿ‡ธ\" },\n { value: \"PT\", label: \"Portugal\", emoji: \"๐Ÿ‡ต๐Ÿ‡น\" },\n { value: \"PW\", label: \"Palau\", emoji: \"๐Ÿ‡ต๐Ÿ‡ผ\" },\n { value: \"PY\", label: \"Paraguay\", emoji: \"๐Ÿ‡ต๐Ÿ‡พ\" },\n { value: \"QA\", label: \"Qatar\", emoji: \"๐Ÿ‡ถ๐Ÿ‡ฆ\" },\n { value: \"RE\", label: \"Rรฉunion\", emoji: \"๐Ÿ‡ท๐Ÿ‡ช\" },\n { value: \"RO\", label: \"Romania\", emoji: \"๐Ÿ‡ท๐Ÿ‡ด\" },\n { value: \"RS\", label: \"Serbia\", emoji: \"๐Ÿ‡ท๐Ÿ‡ธ\" },\n { value: \"RU\", label: \"Russian Federation\", emoji: \"๐Ÿ‡ท๐Ÿ‡บ\" },\n { value: \"RW\", label: \"Rwanda\", emoji: \"๐Ÿ‡ท๐Ÿ‡ผ\" },\n { value: \"SA\", label: \"Saudi Arabia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฆ\" },\n { value: \"SB\", label: \"Solomon Islands\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ง\" },\n { value: \"SC\", label: \"Seychelles\", emoji: \"๐Ÿ‡ธ๐Ÿ‡จ\" },\n { value: \"SD\", label: \"Sudan\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฉ\" },\n { value: \"SE\", label: \"Sweden\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ช\" },\n { value: \"SG\", label: \"Singapore\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฌ\" },\n {\n value: \"SH\",\n label: \"Saint Helena, Ascension and Tristan da Cunha\",\n emoji: \"๐Ÿ‡ธ๐Ÿ‡ญ\",\n },\n { value: \"SI\", label: \"Slovenia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฎ\" },\n { value: \"SJ\", label: \"Svalbard and Jan Mayen\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฏ\" },\n { value: \"SK\", label: \"Slovakia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฐ\" },\n { value: \"SL\", label: \"Sierra Leone\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฑ\" },\n { value: \"SM\", label: \"San Marino\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฒ\" },\n { value: \"SN\", label: \"Senegal\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ณ\" },\n { value: \"SO\", label: \"Somalia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ด\" },\n { value: \"SR\", label: \"Suriname\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ท\" },\n { value: \"SS\", label: \"South Sudan\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ธ\" },\n { value: \"ST\", label: \"Sao Tome and Principe\", emoji: \"๐Ÿ‡ธ๐Ÿ‡น\" },\n { value: \"SV\", label: \"El Salvador\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ป\" },\n { value: \"SX\", label: \"Sint Maarten, (Dutch part)\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฝ\" },\n { value: \"SY\", label: \"Syrian Arab Republic\", emoji: \"๐Ÿ‡ธ๐Ÿ‡พ\" },\n { value: \"SZ\", label: \"Eswatini\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฟ\" },\n { value: \"TC\", label: \"Turks and Caicos Islands\", emoji: \"๐Ÿ‡น๐Ÿ‡จ\" },\n { value: \"TD\", label: \"Chad\", emoji: \"๐Ÿ‡น๐Ÿ‡ฉ\" },\n { value: \"TF\", label: \"French Southern Territories\", emoji: \"๐Ÿ‡น๐Ÿ‡ซ\" },\n { value: \"TG\", label: \"Togo\", emoji: \"๐Ÿ‡น๐Ÿ‡ฌ\" },\n { value: \"TH\", label: \"Thailand\", emoji: \"๐Ÿ‡น๐Ÿ‡ญ\" },\n { value: \"TJ\", label: \"Tajikistan\", emoji: \"๐Ÿ‡น๐Ÿ‡ฏ\" },\n { value: \"TK\", label: \"Tokelau\", emoji: \"๐Ÿ‡น๐Ÿ‡ฐ\" },\n { value: \"TL\", label: \"Timor-Leste\", emoji: \"๐Ÿ‡น๐Ÿ‡ฑ\" },\n { value: \"TM\", label: \"Turkmenistan\", emoji: \"๐Ÿ‡น๐Ÿ‡ฒ\" },\n { value: \"TN\", label: \"Tunisia\", emoji: \"๐Ÿ‡น๐Ÿ‡ณ\" },\n { value: \"TO\", label: \"Tonga\", emoji: \"๐Ÿ‡น๐Ÿ‡ด\" },\n { value: \"TR\", label: \"Tรผrkiye\", emoji: \"๐Ÿ‡น๐Ÿ‡ท\" },\n { value: \"TT\", label: \"Trinidad and Tobago\", emoji: \"๐Ÿ‡น๐Ÿ‡น\" },\n { value: \"TV\", label: \"Tuvalu\", emoji: \"๐Ÿ‡น๐Ÿ‡ป\" },\n { value: \"TW\", label: \"Taiwan, Province of China\", emoji: \"๐Ÿ‡น๐Ÿ‡ผ\" },\n { value: \"TZ\", label: \"Tanzania, United Republic of\", emoji: \"๐Ÿ‡น๐Ÿ‡ฟ\" },\n { value: \"UA\", label: \"Ukraine\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฆ\" },\n { value: \"UG\", label: \"Uganda\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฌ\" },\n { value: \"UM\", label: \"United States Minor Outlying Islands\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฒ\" },\n { value: \"US\", label: \"United States of America\", emoji: \"๐Ÿ‡บ๐Ÿ‡ธ\" },\n { value: \"UY\", label: \"Uruguay\", emoji: \"๐Ÿ‡บ๐Ÿ‡พ\" },\n { value: \"UZ\", label: \"Uzbekistan\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฟ\" },\n { value: \"VA\", label: \"Holy See\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฆ\" },\n { value: \"VC\", label: \"Saint Vincent and the Grenadines\", emoji: \"๐Ÿ‡ป๐Ÿ‡จ\" },\n { value: \"VE\", label: \"Venezuela, Bolivarian Republic of\", emoji: \"๐Ÿ‡ป๐Ÿ‡ช\" },\n { value: \"VG\", label: \"Virgin Islands, British\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฌ\" },\n { value: \"VI\", label: \"Virgin Islands, U.S.\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฎ\" },\n { value: \"VN\", label: \"Viet Nam\", emoji: \"๐Ÿ‡ป๐Ÿ‡ณ\" },\n { value: \"VU\", label: \"Vanuatu\", emoji: \"๐Ÿ‡ป๐Ÿ‡บ\" },\n { value: \"WF\", label: \"Wallis and Futuna\", emoji: \"๐Ÿ‡ผ๐Ÿ‡ซ\" },\n { value: \"WS\", label: \"Samoa\", emoji: \"๐Ÿ‡ผ๐Ÿ‡ธ\" },\n { value: \"YE\", label: \"Yemen\", emoji: \"๐Ÿ‡พ๐Ÿ‡ช\" },\n { value: \"YT\", label: \"Mayotte\", emoji: \"๐Ÿ‡พ๐Ÿ‡น\" },\n { value: \"ZA\", label: \"South Africa\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ฆ\" },\n { value: \"ZM\", label: \"Zambia\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ฒ\" },\n { value: \"ZW\", label: \"Zimbabwe\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ผ\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useVirtualizer } from \"@tanstack/react-virtual\"", "import { useRef } from \"react\"", "import { flushSync } from \"react-dom\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "@tanstack/react-virtual" ] }, { "name": "combobox-with-async-content", "content": "\"use client\"\nexport const ComboboxWithAsyncContent = () => {\n const [inputValue, setInputValue] = useState(\"\")\n\n const { collection, set } = useListCollection({\n initialItems: [],\n itemToString: (item) => item.name,\n itemToValue: (item) => item.name,\n })\n\n const state = useAsync(async () => {\n const response = await fetch(\n `https://swapi.py4e.com/api/people/?search=${inputValue}`,\n )\n const data = await response.json()\n set(data.results)\n }, [inputValue, set])\n\n return (\n setInputValue(e.inputValue)}\n positioning={{ sameWidth: false, placement: \"bottom-start\" }}\n >\n Search Star Wars Characters\n\n \n \n \n \n \n \n \n\n \n \n \n {state.loading ? (\n \n \n Loading...\n \n ) : state.error ? (\n \n Error fetching\n \n ) : (\n collection.items?.map((character) => (\n \n \n \n {character.name}\n \n \n {character.height}cm / {character.mass}kg\n \n \n \n \n ))\n )}\n \n \n \n \n )\n}\n\ninterface Character {\n name: string\n height: string\n mass: string\n created: string\n edited: string\n url: string\n}\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n HStack,\n Portal,\n Span,\n Spinner,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useState } from \"react\"", "import { useAsync } from \"react-use\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "react-use" ] }, { "name": "combobox-with-createable-options", "content": "\"use client\"\n\ninterface Tag {\n id: string\n name: string\n custom?: boolean\n}\n\nconst defaultTags: Tag[] = [\n { id: \"react\", name: \"react\" },\n { id: \"typescript\", name: \"typescript\" },\n { id: \"javascript\", name: \"javascript\" },\n { id: \"nextjs\", name: \"nextjs\" },\n]\n\nexport const ComboboxWithCreateableOptions = () => {\n const [tags, setTags] = useState(defaultTags)\n const [inputValue, setInputValue] = useState(\"\")\n const [value, setValue] = useState([])\n\n const collection = useMemo(\n () =>\n createListCollection({\n items: tags,\n itemToString: (item) => item.name,\n itemToValue: (item) => item.id,\n }),\n [tags],\n )\n\n const handleValueChange = (details: Combobox.ValueChangeDetails) => {\n const selectedValue = details.value[0]\n\n const selectedTag = collection.find(selectedValue)\n\n const tempTags = tags.map((tag) => {\n if (tag.id === \"custom\" && selectedTag) {\n return { id: selectedTag.name, name: selectedTag.name, custom: true }\n }\n\n return tag\n })\n\n setValue(\n selectedValue === \"custom\" && selectedTag\n ? [selectedTag?.name]\n : details.value,\n )\n setTags(tempTags)\n\n setInputValue(selectedTag?.name ?? \"\")\n }\n\n const handleInputChange = (details: Combobox.InputValueChangeDetails) => {\n const value = details.inputValue\n\n if (!value) {\n return\n }\n\n const newTag: Tag = {\n id: \"custom\",\n name: value,\n }\n\n setTags((prev) => {\n if (collection.has(\"custom\")) {\n return prev.map((tag) => {\n if (tag.id === \"custom\") {\n return newTag\n }\n return tag\n })\n }\n\n return [newTag, ...prev]\n })\n\n setInputValue(value)\n }\n\n return (\n \n \n Add Tags\n\n \n \n \n \n \n \n \n\n \n \n \n {collection.items.map((tag) => {\n if (tag.id === \"custom\") {\n return (\n \n \n \n \n \n \n \n \n Create "{inputValue}"\n \n \n \n )\n }\n\n return (\n \n \n \n {tag.name}\n {tag.custom && (\n \n CUSTOM\n \n )}\n \n \n \n \n )\n })}\n \n \n \n \n\n \n Current Tags:\n \n {tags.map((tag) => (\n \n {tag.name}\n \n ))}\n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n HStack,\n Icon,\n Portal,\n Stack,\n Text,\n createListCollection,\n} from \"@chakra-ui/react\"", "import { useMemo, useState } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-custom-animation", "content": "\"use client\"\nexport const ComboboxWithCustomAnimation = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n positioning={{ flip: false, gutter: 2 }}\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-custom-filter", "content": "\"use client\"\nexport const ComboboxWithCustomFilter = () => {\n const { collection, set } = useListCollection({\n initialItems: people,\n itemToString: (item) => item.name,\n itemToValue: (item) => item.id.toString(),\n })\n\n const handleInputChange = (details: Combobox.InputValueChangeDetails) => {\n const filteredItems = people.filter((item) => {\n const searchLower = details.inputValue.toLowerCase()\n const nameParts = item.name.toLowerCase().split(\" \")\n const emailParts = item.email.toLowerCase().split(\"@\")[0].split(\".\")\n\n return (\n item.name.toLowerCase().includes(searchLower) ||\n nameParts.some((part) => part.includes(searchLower)) ||\n emailParts.some((part) => part.includes(searchLower)) ||\n item.role.toLowerCase().includes(searchLower)\n )\n })\n set(filteredItems)\n }\n\n return (\n \n Select Person\n\n \n \n \n \n \n \n \n\n \n \n \n No matches found\n {collection.items.map((person) => (\n \n \n \n {person.name}\n \n \n {person.email}\n \n \n \n \n ))}\n \n \n \n \n )\n}\n\nconst people = [\n {\n id: 1,\n name: \"John Smith\",\n email: \"john@example.com\",\n role: \"Sales Manager\",\n },\n {\n id: 2,\n name: \"Sarah Johnson\",\n email: \"sarah@example.com\",\n role: \"UI Designer\",\n },\n {\n id: 3,\n name: \"Michael Brown\",\n email: \"michael@example.com\",\n role: \"Software Engineer\",\n },\n {\n id: 4,\n name: \"Emily Davis\",\n email: \"emily@example.com\",\n role: \"AI Engineer\",\n },\n {\n id: 5,\n name: \"James Wilson\",\n email: \"james@example.com\",\n role: \"Chief Executive Officer\",\n },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n Span,\n Stack,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-custom-item", "content": "\"use client\"\n\nfunction ComboboxValue() {\n const combobox = useComboboxContext()\n const selectedItems = combobox.selectedItems as (typeof items)[number][]\n return (\n \n {selectedItems.map((item) => (\n \n \n {item.label}\n \n ))}\n \n )\n}\n\nexport const ComboboxWithCustomItem = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: items,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n placeholder=\"Example: Audi\"\n multiple\n closeOnSelect\n >\n Search and select car brands\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label\n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nexport const items = [\n {\n label: \"Audi\",\n value: \"audi\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/audi-logo.png\",\n },\n {\n label: \"BMW\",\n value: \"bmw\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/bmw-logo.png\",\n },\n {\n label: \"Citroen\",\n value: \"citroen\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/citroen-logo.png\",\n },\n {\n label: \"Dacia\",\n value: \"dacia\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/dacia-logo.png\",\n },\n {\n label: \"Fiat\",\n value: \"fiat\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/fiat-logo.png\",\n },\n {\n label: \"Ford\",\n value: \"ford\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ford-logo.png\",\n },\n {\n label: \"Ferrari\",\n value: \"ferrari\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ferrari-logo.png\",\n },\n {\n label: \"Honda\",\n value: \"honda\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/honda-logo.png\",\n },\n {\n label: \"Hyundai\",\n value: \"hyundai\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/hyundai-logo.png\",\n },\n {\n label: \"Jaguar\",\n value: \"jaguar\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jaguar-logo.png\",\n },\n {\n label: \"Jeep\",\n value: \"jeep\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jeep-logo.png\",\n },\n {\n label: \"Kia\",\n value: \"kia\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/kia-logo.png\",\n },\n {\n label: \"Land Rover\",\n value: \"land rover\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/land-rover-logo.png\",\n },\n {\n label: \"Mazda\",\n value: \"mazda\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mazda-logo.png\",\n },\n {\n label: \"Mercedes\",\n value: \"mercedes\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mercedes-logo.png\",\n },\n {\n label: \"Mini\",\n value: \"mini\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mini-logo.png\",\n },\n {\n label: \"Mitsubishi\",\n value: \"mitsubishi\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mitsubishi-logo.png\",\n },\n {\n label: \"Nissan\",\n value: \"nissan\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/nissan-logo.png\",\n },\n {\n label: \"Opel\",\n value: \"opel\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/opel-logo.png\",\n },\n {\n label: \"Peugeot\",\n value: \"peugeot\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/peugeot-logo.png\",\n },\n {\n label: \"Porsche\",\n value: \"porsche\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/porsche-logo.png\",\n },\n {\n label: \"Renault\",\n value: \"renault\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/renault-logo.png\",\n },\n {\n label: \"Saab\",\n value: \"saab\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/saab-logo.png\",\n },\n {\n label: \"Skoda\",\n value: \"skoda\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/skoda-logo.png\",\n },\n {\n label: \"Subaru\",\n value: \"subaru\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/subaru-logo.png\",\n },\n {\n label: \"Suzuki\",\n value: \"suzuki\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/suzuki-logo.png\",\n },\n {\n label: \"Toyota\",\n value: \"toyota\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/toyota-logo.png\",\n },\n {\n label: \"Volkswagen\",\n value: \"volkswagen\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volkswagen-logo.png\",\n },\n {\n label: \"Volvo\",\n value: \"volvo\",\n logo: \"https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volvo-logo.png\",\n },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n HStack,\n Image,\n Portal,\n Span,\n Stack,\n useComboboxContext,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-custom-object", "content": "\"use client\"\nexport const ComboboxWithCustomObject = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: countries,\n itemToString: (item) => item.country,\n itemToValue: (item) => item.code,\n filter: contains,\n })\n\n const handleInputChange = (details: Combobox.InputValueChangeDetails) => {\n filter(details.inputValue)\n }\n\n return (\n \n Search Countries\n \n \n \n \n \n \n\n \n \n \n No items found\n\n {collection.items.map((item) => (\n \n {item.country}\n \n ))}\n \n \n \n \n )\n}\n\nconst countries = [\n { country: \"United States\", code: \"US\", flag: \"๐Ÿ‡บ๐Ÿ‡ธ\" },\n { country: \"Canada\", code: \"CA\", flag: \"๐Ÿ‡จ๐Ÿ‡ฆ\" },\n { country: \"Australia\", code: \"AU\", flag: \"๐Ÿ‡ฆ๐Ÿ‡บ\" },\n { country: \"United Kingdom\", code: \"UK\", flag: \"๐Ÿ‡ฌ๐Ÿ‡ง\" },\n { country: \"New Zealand\", code: \"NZ\", flag: \"๐Ÿ‡ณ๐Ÿ‡ฟ\" },\n { country: \"South Africa\", code: \"ZA\", flag: \"๐Ÿ‡ฟ๐Ÿ‡ฆ\" },\n { country: \"India\", code: \"IN\", flag: \"๐Ÿ‡ฎ๐Ÿ‡ณ\" },\n { country: \"China\", code: \"CN\", flag: \"๐Ÿ‡จ๐Ÿ‡ณ\" },\n { country: \"Japan\", code: \"JP\", flag: \"๐Ÿ‡ฏ๐Ÿ‡ต\" },\n { country: \"Korea\", code: \"KR\", flag: \"๐Ÿ‡ฐ๐Ÿ‡ท\" },\n { country: \"Vietnam\", code: \"VN\", flag: \"๐Ÿ‡ป๐Ÿ‡ณ\" },\n { country: \"Thailand\", code: \"TH\", flag: \"๐Ÿ‡น๐Ÿ‡ญ\" },\n { country: \"Malaysia\", code: \"MY\", flag: \"๐Ÿ‡ฒ๐Ÿ‡พ\" },\n { country: \"Indonesia\", code: \"ID\", flag: \"๐Ÿ‡ฎ๐Ÿ‡ฉ\" },\n { country: \"Philippines\", code: \"PH\", flag: \"๐Ÿ‡ต๐Ÿ‡ญ\" },\n { country: \"Singapore\", code: \"SG\", flag: \"๐Ÿ‡ธ๐Ÿ‡ฌ\" },\n { country: \"Hong Kong\", code: \"HK\", flag: \"๐Ÿ‡ญ๐Ÿ‡ฐ\" },\n { country: \"Macau\", code: \"MO\", flag: \"๐Ÿ‡ฒ๐Ÿ‡ด\" },\n { country: \"Taiwan\", code: \"TW\", flag: \"๐Ÿ‡น๐Ÿ‡ผ\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-disabled-item", "content": "\"use client\"\nexport const ComboboxWithDisabledItem = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: companies,\n filter: contains,\n itemToValue: (item) => item.id,\n itemToString: (item) => item.name,\n isItemDisabled: (item) => !!item.disabled,\n })\n\n const handleInputChange = (details: Combobox.InputValueChangeDetails) => {\n filter(details.inputValue)\n }\n\n return (\n \n Select a Company\n \n \n \n \n \n \n \n\n \n \n \n \n Companies\n {collection.items.map((country) => {\n return (\n \n \n {country.logo}\n {country.name}\n \n \n \n )\n })}\n \n \n \n \n \n )\n}\n\ninterface Company {\n id: string\n name: string\n logo: React.ReactElement\n disabled?: boolean\n}\n\nconst companies: Company[] = [\n {\n id: \"airbnb\",\n name: \"Airbnb\",\n logo: (\n \n \n \n \n \n \n \n \n \n \n \n ),\n },\n {\n id: \"tesla\",\n disabled: true,\n logo: (\n \n \n \n \n \n \n \n \n \n \n \n \n ),\n name: \"Tesla\",\n },\n {\n logo: (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ),\n id: \"nvida\",\n name: \"NVIDA\",\n },\n {\n id: \"amazon\",\n name: \"Amazon\",\n logo: (\n \n \n \n \n \n \n \n \n \n \n \n \n ),\n },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n HStack,\n Icon,\n Portal,\n Span,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-disabled", "content": "\"use client\"\nexport const ComboboxWithDisabled = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n disabled\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-field", "content": "\"use client\"\nexport const ComboboxWithField = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n \n Select framework\n filter(e.inputValue)}\n >\n \n \n \n \n \n \n \n The framework you love to use\n\n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Field,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-highlight", "content": "\"use client\"\nexport const ComboboxWithHighlight = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n ))}\n \n \n \n \n )\n}\n\nfunction ComboboxItem(props: { item: { label: string; value: string } }) {\n const { item } = props\n const combobox = useComboboxContext()\n return (\n \n \n \n {item.label}\n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Highlight,\n Portal,\n useComboboxContext,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-input-group", "content": "\"use client\"\nexport const ComboboxWithInputGroup = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n >\n Select framework\n \n }>\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n InputGroup,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { LuCode } from \"react-icons/lu\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "react-icons" ] }, { "name": "combobox-with-input-in-content", "content": "\"use client\"\nexport const ComboboxWithInputInContent = () => {\n const [selected, setSelected] = useState({\n value: [],\n items: [],\n })\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { filter, collection } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n const handleInputChange = (details: Combobox.InputValueChangeDetails) => {\n filter(details.inputValue)\n }\n\n const handleValueChange = (details: Combobox.ValueChangeDetails) => {\n setSelected(details)\n }\n\n return (\n \n \n \n \n \n \n\n \n \n \n \n \n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n \n )\n}\n\ninterface SelectedState {\n value: string[]\n items: Item[]\n}\n\ninterface Item {\n label: string\n value: string\n}\n\nconst frameworks = [\n { label: \"Todo\", value: \"todo\" },\n { label: \"In Progress\", value: \"in-progress\" },\n { label: \"Done\", value: \"done\" },\n { label: \"Blocked\", value: \"blocked\" },\n { label: \"Review\", value: \"review\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Button,\n Combobox,\n Portal,\n Show,\n Span,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useState } from \"react\"", "import { LuChevronsUpDown } from \"react-icons/lu\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "react-icons" ] }, { "name": "combobox-with-invalid", "content": "\"use client\"\nexport const ComboboxWithInvalid = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n invalid\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-limit", "content": "\"use client\"\nexport const ComboboxWithLimit = () => {\n const contentRef = useRef(null)\n\n const { startsWith } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter, reset } = useListCollection({\n initialItems: items,\n filter: startsWith,\n limit: 10,\n })\n\n return (\n filter(e.inputValue)}\n openOnClick\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n {collection.items.map((item) => (\n \n \n \n {item.emoji}\n \n {item.label}\n \n \n \n ))}\n \n \n \n \n )\n}\n\nexport const items = [\n { value: \"AD\", label: \"Andorra\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฉ\" },\n { value: \"AE\", label: \"United Arab Emirates\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ช\" },\n { value: \"AF\", label: \"Afghanistan\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ซ\" },\n { value: \"AG\", label: \"Antigua and Barbuda\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฌ\" },\n { value: \"AI\", label: \"Anguilla\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฎ\" },\n { value: \"AL\", label: \"Albania\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฑ\" },\n { value: \"AM\", label: \"Armenia\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฒ\" },\n { value: \"AO\", label: \"Angola\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ด\" },\n { value: \"AQ\", label: \"Antarctica\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ถ\" },\n { value: \"AR\", label: \"Argentina\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ท\" },\n { value: \"AS\", label: \"American Samoa\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ธ\" },\n { value: \"AT\", label: \"Austria\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡น\" },\n { value: \"AU\", label: \"Australia\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡บ\" },\n { value: \"AW\", label: \"Aruba\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ผ\" },\n { value: \"AX\", label: \"ร…land Islands\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฝ\" },\n { value: \"AZ\", label: \"Azerbaijan\", emoji: \"๐Ÿ‡ฆ๐Ÿ‡ฟ\" },\n { value: \"BA\", label: \"Bosnia and Herzegovina\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฆ\" },\n { value: \"BB\", label: \"Barbados\", emoji: \"๐Ÿ‡ง๐Ÿ‡ง\" },\n { value: \"BD\", label: \"Bangladesh\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฉ\" },\n { value: \"BE\", label: \"Belgium\", emoji: \"๐Ÿ‡ง๐Ÿ‡ช\" },\n { value: \"BF\", label: \"Burkina Faso\", emoji: \"๐Ÿ‡ง๐Ÿ‡ซ\" },\n { value: \"BG\", label: \"Bulgaria\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฌ\" },\n { value: \"BH\", label: \"Bahrain\", emoji: \"๐Ÿ‡ง๐Ÿ‡ญ\" },\n { value: \"BI\", label: \"Burundi\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฎ\" },\n { value: \"BJ\", label: \"Benin\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฏ\" },\n { value: \"BL\", label: \"Saint Barthรฉlemy\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฑ\" },\n { value: \"BM\", label: \"Bermuda\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฒ\" },\n { value: \"BN\", label: \"Brunei Darussalam\", emoji: \"๐Ÿ‡ง๐Ÿ‡ณ\" },\n { value: \"BO\", label: \"Bolivia, Plurinational State of\", emoji: \"๐Ÿ‡ง๐Ÿ‡ด\" },\n { value: \"BQ\", label: \"Bonaire, Sint Eustatius and Saba\", emoji: \"๐Ÿ‡ง๐Ÿ‡ถ\" },\n { value: \"BR\", label: \"Brazil\", emoji: \"๐Ÿ‡ง๐Ÿ‡ท\" },\n { value: \"BS\", label: \"Bahamas\", emoji: \"๐Ÿ‡ง๐Ÿ‡ธ\" },\n { value: \"BT\", label: \"Bhutan\", emoji: \"๐Ÿ‡ง๐Ÿ‡น\" },\n { value: \"BV\", label: \"Bouvet Island\", emoji: \"๐Ÿ‡ง๐Ÿ‡ป\" },\n { value: \"BW\", label: \"Botswana\", emoji: \"๐Ÿ‡ง๐Ÿ‡ผ\" },\n { value: \"BY\", label: \"Belarus\", emoji: \"๐Ÿ‡ง๐Ÿ‡พ\" },\n { value: \"BZ\", label: \"Belize\", emoji: \"๐Ÿ‡ง๐Ÿ‡ฟ\" },\n { value: \"CA\", label: \"Canada\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฆ\" },\n { value: \"CC\", label: \"Cocos (Keeling) Islands\", emoji: \"๐Ÿ‡จ๐Ÿ‡จ\" },\n { value: \"CD\", label: \"Congo, Democratic Republic of the\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฉ\" },\n { value: \"CF\", label: \"Central African Republic\", emoji: \"๐Ÿ‡จ๐Ÿ‡ซ\" },\n { value: \"CG\", label: \"Congo\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฌ\" },\n { value: \"CH\", label: \"Switzerland\", emoji: \"๐Ÿ‡จ๐Ÿ‡ญ\" },\n { value: \"CI\", label: \"Cรดte d'Ivoire\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฎ\" },\n { value: \"CK\", label: \"Cook Islands\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฐ\" },\n { value: \"CL\", label: \"Chile\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฑ\" },\n { value: \"CM\", label: \"Cameroon\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฒ\" },\n { value: \"CN\", label: \"China\", emoji: \"๐Ÿ‡จ๐Ÿ‡ณ\" },\n { value: \"CO\", label: \"Colombia\", emoji: \"๐Ÿ‡จ๐Ÿ‡ด\" },\n { value: \"CR\", label: \"Costa Rica\", emoji: \"๐Ÿ‡จ๐Ÿ‡ท\" },\n { value: \"CU\", label: \"Cuba\", emoji: \"๐Ÿ‡จ๐Ÿ‡บ\" },\n { value: \"CV\", label: \"Cabo Verde\", emoji: \"๐Ÿ‡จ๐Ÿ‡ป\" },\n { value: \"CW\", label: \"Curaรงao\", emoji: \"๐Ÿ‡จ๐Ÿ‡ผ\" },\n { value: \"CX\", label: \"Christmas Island\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฝ\" },\n { value: \"CY\", label: \"Cyprus\", emoji: \"๐Ÿ‡จ๐Ÿ‡พ\" },\n { value: \"CZ\", label: \"Czechia\", emoji: \"๐Ÿ‡จ๐Ÿ‡ฟ\" },\n { value: \"DE\", label: \"Germany\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ช\" },\n { value: \"DJ\", label: \"Djibouti\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฏ\" },\n { value: \"DK\", label: \"Denmark\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฐ\" },\n { value: \"DM\", label: \"Dominica\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฒ\" },\n { value: \"DO\", label: \"Dominican Republic\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ด\" },\n { value: \"DZ\", label: \"Algeria\", emoji: \"๐Ÿ‡ฉ๐Ÿ‡ฟ\" },\n { value: \"EC\", label: \"Ecuador\", emoji: \"๐Ÿ‡ช๐Ÿ‡จ\" },\n { value: \"EE\", label: \"Estonia\", emoji: \"๐Ÿ‡ช๐Ÿ‡ช\" },\n { value: \"EG\", label: \"Egypt\", emoji: \"๐Ÿ‡ช๐Ÿ‡ฌ\" },\n { value: \"EH\", label: \"Western Sahara\", emoji: \"๐Ÿ‡ช๐Ÿ‡ญ\" },\n { value: \"ER\", label: \"Eritrea\", emoji: \"๐Ÿ‡ช๐Ÿ‡ท\" },\n { value: \"ES\", label: \"Spain\", emoji: \"๐Ÿ‡ช๐Ÿ‡ธ\" },\n { value: \"ET\", label: \"Ethiopia\", emoji: \"๐Ÿ‡ช๐Ÿ‡น\" },\n { value: \"FI\", label: \"Finland\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฎ\" },\n { value: \"FJ\", label: \"Fiji\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฏ\" },\n { value: \"FK\", label: \"Falkland Islands (Malvinas)\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฐ\" },\n { value: \"FM\", label: \"Micronesia, Federated States of\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ฒ\" },\n { value: \"FO\", label: \"Faroe Islands\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ด\" },\n { value: \"FR\", label: \"France\", emoji: \"๐Ÿ‡ซ๐Ÿ‡ท\" },\n { value: \"GA\", label: \"Gabon\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฆ\" },\n {\n value: \"GB\",\n label: \"United Kingdom of Great Britain and Northern Ireland\",\n emoji: \"๐Ÿ‡ฌ๐Ÿ‡ง\",\n },\n { value: \"GD\", label: \"Grenada\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฉ\" },\n { value: \"GE\", label: \"Georgia\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ช\" },\n { value: \"GF\", label: \"French Guiana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ซ\" },\n { value: \"GG\", label: \"Guernsey\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฌ\" },\n { value: \"GH\", label: \"Ghana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ญ\" },\n { value: \"GI\", label: \"Gibraltar\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฎ\" },\n { value: \"GL\", label: \"Greenland\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฑ\" },\n { value: \"GM\", label: \"Gambia\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ฒ\" },\n { value: \"GN\", label: \"Guinea\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ณ\" },\n { value: \"GP\", label: \"Guadeloupe\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ต\" },\n { value: \"GQ\", label: \"Equatorial Guinea\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ถ\" },\n { value: \"GR\", label: \"Greece\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ท\" },\n {\n value: \"GS\",\n label: \"South Georgia and the South Sandwich Islands\",\n emoji: \"๐Ÿ‡ฌ๐Ÿ‡ธ\",\n },\n { value: \"GT\", label: \"Guatemala\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡น\" },\n { value: \"GU\", label: \"Guam\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡บ\" },\n { value: \"GW\", label: \"Guinea-Bissau\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡ผ\" },\n { value: \"GY\", label: \"Guyana\", emoji: \"๐Ÿ‡ฌ๐Ÿ‡พ\" },\n { value: \"HK\", label: \"Hong Kong\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ฐ\" },\n { value: \"HM\", label: \"Heard Island and McDonald Islands\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ฒ\" },\n { value: \"HN\", label: \"Honduras\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ณ\" },\n { value: \"HR\", label: \"Croatia\", emoji: \"๐Ÿ‡ญ๐Ÿ‡ท\" },\n { value: \"HT\", label: \"Haiti\", emoji: \"๐Ÿ‡ญ๐Ÿ‡น\" },\n { value: \"HU\", label: \"Hungary\", emoji: \"๐Ÿ‡ญ๐Ÿ‡บ\" },\n { value: \"ID\", label: \"Indonesia\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฉ\" },\n { value: \"IE\", label: \"Ireland\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ช\" },\n { value: \"IL\", label: \"Israel\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฑ\" },\n { value: \"IM\", label: \"Isle of Man\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ฒ\" },\n { value: \"IN\", label: \"India\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ณ\" },\n { value: \"IO\", label: \"British Indian Ocean Territory\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ด\" },\n { value: \"IQ\", label: \"Iraq\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ถ\" },\n { value: \"IR\", label: \"Iran, Islamic Republic of\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ท\" },\n { value: \"IS\", label: \"Iceland\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡ธ\" },\n { value: \"IT\", label: \"Italy\", emoji: \"๐Ÿ‡ฎ๐Ÿ‡น\" },\n { value: \"JE\", label: \"Jersey\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ช\" },\n { value: \"JM\", label: \"Jamaica\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ฒ\" },\n { value: \"JO\", label: \"Jordan\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ด\" },\n { value: \"JP\", label: \"Japan\", emoji: \"๐Ÿ‡ฏ๐Ÿ‡ต\" },\n { value: \"KE\", label: \"Kenya\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ช\" },\n { value: \"KG\", label: \"Kyrgyzstan\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฌ\" },\n { value: \"KH\", label: \"Cambodia\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ญ\" },\n { value: \"KI\", label: \"Kiribati\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฎ\" },\n { value: \"KM\", label: \"Comoros\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฒ\" },\n { value: \"KN\", label: \"Saint Kitts and Nevis\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ณ\" },\n { value: \"KP\", label: \"Korea, Democratic People's Republic of\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ต\" },\n { value: \"KR\", label: \"Korea, Republic of\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ท\" },\n { value: \"KW\", label: \"Kuwait\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ผ\" },\n { value: \"KY\", label: \"Cayman Islands\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡พ\" },\n { value: \"KZ\", label: \"Kazakhstan\", emoji: \"๐Ÿ‡ฐ๐Ÿ‡ฟ\" },\n { value: \"LA\", label: \"Lao People's Democratic Republic\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฆ\" },\n { value: \"LB\", label: \"Lebanon\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ง\" },\n { value: \"LC\", label: \"Saint Lucia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡จ\" },\n { value: \"LI\", label: \"Liechtenstein\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฎ\" },\n { value: \"LK\", label: \"Sri Lanka\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ฐ\" },\n { value: \"LR\", label: \"Liberia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ท\" },\n { value: \"LS\", label: \"Lesotho\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ธ\" },\n { value: \"LT\", label: \"Lithuania\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡น\" },\n { value: \"LU\", label: \"Luxembourg\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡บ\" },\n { value: \"LV\", label: \"Latvia\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡ป\" },\n { value: \"LY\", label: \"Libya\", emoji: \"๐Ÿ‡ฑ๐Ÿ‡พ\" },\n { value: \"MA\", label: \"Morocco\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฆ\" },\n { value: \"MC\", label: \"Monaco\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡จ\" },\n { value: \"MD\", label: \"Moldova, Republic of\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฉ\" },\n { value: \"ME\", label: \"Montenegro\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ช\" },\n { value: \"MF\", label: \"Saint Martin, (French part)\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ซ\" },\n { value: \"MG\", label: \"Madagascar\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฌ\" },\n { value: \"MH\", label: \"Marshall Islands\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ญ\" },\n { value: \"MK\", label: \"North Macedonia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฐ\" },\n { value: \"ML\", label: \"Mali\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฑ\" },\n { value: \"MM\", label: \"Myanmar\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฒ\" },\n { value: \"MN\", label: \"Mongolia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ณ\" },\n { value: \"MO\", label: \"Macao\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ด\" },\n { value: \"MP\", label: \"Northern Mariana Islands\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ต\" },\n { value: \"MQ\", label: \"Martinique\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ถ\" },\n { value: \"MR\", label: \"Mauritania\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ท\" },\n { value: \"MS\", label: \"Montserrat\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ธ\" },\n { value: \"MT\", label: \"Malta\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡น\" },\n { value: \"MU\", label: \"Mauritius\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡บ\" },\n { value: \"MV\", label: \"Maldives\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ป\" },\n { value: \"MW\", label: \"Malawi\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ผ\" },\n { value: \"MX\", label: \"Mexico\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฝ\" },\n { value: \"MY\", label: \"Malaysia\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡พ\" },\n { value: \"MZ\", label: \"Mozambique\", emoji: \"๐Ÿ‡ฒ๐Ÿ‡ฟ\" },\n { value: \"NA\", label: \"Namibia\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฆ\" },\n { value: \"NC\", label: \"New Caledonia\", emoji: \"๐Ÿ‡ณ๐Ÿ‡จ\" },\n { value: \"NE\", label: \"Niger\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ช\" },\n { value: \"NF\", label: \"Norfolk Island\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ซ\" },\n { value: \"NG\", label: \"Nigeria\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฌ\" },\n { value: \"NI\", label: \"Nicaragua\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฎ\" },\n { value: \"NL\", label: \"Netherlands\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฑ\" },\n { value: \"NO\", label: \"Norway\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ด\" },\n { value: \"NP\", label: \"Nepal\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ต\" },\n { value: \"NR\", label: \"Nauru\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ท\" },\n { value: \"NU\", label: \"Niue\", emoji: \"๐Ÿ‡ณ๐Ÿ‡บ\" },\n { value: \"NZ\", label: \"New Zealand\", emoji: \"๐Ÿ‡ณ๐Ÿ‡ฟ\" },\n { value: \"OM\", label: \"Oman\", emoji: \"๐Ÿ‡ด๐Ÿ‡ฒ\" },\n { value: \"PA\", label: \"Panama\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฆ\" },\n { value: \"PE\", label: \"Peru\", emoji: \"๐Ÿ‡ต๐Ÿ‡ช\" },\n { value: \"PF\", label: \"French Polynesia\", emoji: \"๐Ÿ‡ต๐Ÿ‡ซ\" },\n { value: \"PG\", label: \"Papua New Guinea\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฌ\" },\n { value: \"PH\", label: \"Philippines\", emoji: \"๐Ÿ‡ต๐Ÿ‡ญ\" },\n { value: \"PK\", label: \"Pakistan\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฐ\" },\n { value: \"PL\", label: \"Poland\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฑ\" },\n { value: \"PM\", label: \"Saint Pierre and Miquelon\", emoji: \"๐Ÿ‡ต๐Ÿ‡ฒ\" },\n { value: \"PN\", label: \"Pitcairn\", emoji: \"๐Ÿ‡ต๐Ÿ‡ณ\" },\n { value: \"PR\", label: \"Puerto Rico\", emoji: \"๐Ÿ‡ต๐Ÿ‡ท\" },\n { value: \"PS\", label: \"Palestine, State of\", emoji: \"๐Ÿ‡ต๐Ÿ‡ธ\" },\n { value: \"PT\", label: \"Portugal\", emoji: \"๐Ÿ‡ต๐Ÿ‡น\" },\n { value: \"PW\", label: \"Palau\", emoji: \"๐Ÿ‡ต๐Ÿ‡ผ\" },\n { value: \"PY\", label: \"Paraguay\", emoji: \"๐Ÿ‡ต๐Ÿ‡พ\" },\n { value: \"QA\", label: \"Qatar\", emoji: \"๐Ÿ‡ถ๐Ÿ‡ฆ\" },\n { value: \"RE\", label: \"Rรฉunion\", emoji: \"๐Ÿ‡ท๐Ÿ‡ช\" },\n { value: \"RO\", label: \"Romania\", emoji: \"๐Ÿ‡ท๐Ÿ‡ด\" },\n { value: \"RS\", label: \"Serbia\", emoji: \"๐Ÿ‡ท๐Ÿ‡ธ\" },\n { value: \"RU\", label: \"Russian Federation\", emoji: \"๐Ÿ‡ท๐Ÿ‡บ\" },\n { value: \"RW\", label: \"Rwanda\", emoji: \"๐Ÿ‡ท๐Ÿ‡ผ\" },\n { value: \"SA\", label: \"Saudi Arabia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฆ\" },\n { value: \"SB\", label: \"Solomon Islands\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ง\" },\n { value: \"SC\", label: \"Seychelles\", emoji: \"๐Ÿ‡ธ๐Ÿ‡จ\" },\n { value: \"SD\", label: \"Sudan\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฉ\" },\n { value: \"SE\", label: \"Sweden\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ช\" },\n { value: \"SG\", label: \"Singapore\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฌ\" },\n {\n value: \"SH\",\n label: \"Saint Helena, Ascension and Tristan da Cunha\",\n emoji: \"๐Ÿ‡ธ๐Ÿ‡ญ\",\n },\n { value: \"SI\", label: \"Slovenia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฎ\" },\n { value: \"SJ\", label: \"Svalbard and Jan Mayen\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฏ\" },\n { value: \"SK\", label: \"Slovakia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฐ\" },\n { value: \"SL\", label: \"Sierra Leone\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฑ\" },\n { value: \"SM\", label: \"San Marino\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฒ\" },\n { value: \"SN\", label: \"Senegal\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ณ\" },\n { value: \"SO\", label: \"Somalia\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ด\" },\n { value: \"SR\", label: \"Suriname\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ท\" },\n { value: \"SS\", label: \"South Sudan\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ธ\" },\n { value: \"ST\", label: \"Sao Tome and Principe\", emoji: \"๐Ÿ‡ธ๐Ÿ‡น\" },\n { value: \"SV\", label: \"El Salvador\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ป\" },\n { value: \"SX\", label: \"Sint Maarten, (Dutch part)\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฝ\" },\n { value: \"SY\", label: \"Syrian Arab Republic\", emoji: \"๐Ÿ‡ธ๐Ÿ‡พ\" },\n { value: \"SZ\", label: \"Eswatini\", emoji: \"๐Ÿ‡ธ๐Ÿ‡ฟ\" },\n { value: \"TC\", label: \"Turks and Caicos Islands\", emoji: \"๐Ÿ‡น๐Ÿ‡จ\" },\n { value: \"TD\", label: \"Chad\", emoji: \"๐Ÿ‡น๐Ÿ‡ฉ\" },\n { value: \"TF\", label: \"French Southern Territories\", emoji: \"๐Ÿ‡น๐Ÿ‡ซ\" },\n { value: \"TG\", label: \"Togo\", emoji: \"๐Ÿ‡น๐Ÿ‡ฌ\" },\n { value: \"TH\", label: \"Thailand\", emoji: \"๐Ÿ‡น๐Ÿ‡ญ\" },\n { value: \"TJ\", label: \"Tajikistan\", emoji: \"๐Ÿ‡น๐Ÿ‡ฏ\" },\n { value: \"TK\", label: \"Tokelau\", emoji: \"๐Ÿ‡น๐Ÿ‡ฐ\" },\n { value: \"TL\", label: \"Timor-Leste\", emoji: \"๐Ÿ‡น๐Ÿ‡ฑ\" },\n { value: \"TM\", label: \"Turkmenistan\", emoji: \"๐Ÿ‡น๐Ÿ‡ฒ\" },\n { value: \"TN\", label: \"Tunisia\", emoji: \"๐Ÿ‡น๐Ÿ‡ณ\" },\n { value: \"TO\", label: \"Tonga\", emoji: \"๐Ÿ‡น๐Ÿ‡ด\" },\n { value: \"TR\", label: \"Tรผrkiye\", emoji: \"๐Ÿ‡น๐Ÿ‡ท\" },\n { value: \"TT\", label: \"Trinidad and Tobago\", emoji: \"๐Ÿ‡น๐Ÿ‡น\" },\n { value: \"TV\", label: \"Tuvalu\", emoji: \"๐Ÿ‡น๐Ÿ‡ป\" },\n { value: \"TW\", label: \"Taiwan, Province of China\", emoji: \"๐Ÿ‡น๐Ÿ‡ผ\" },\n { value: \"TZ\", label: \"Tanzania, United Republic of\", emoji: \"๐Ÿ‡น๐Ÿ‡ฟ\" },\n { value: \"UA\", label: \"Ukraine\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฆ\" },\n { value: \"UG\", label: \"Uganda\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฌ\" },\n { value: \"UM\", label: \"United States Minor Outlying Islands\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฒ\" },\n { value: \"US\", label: \"United States of America\", emoji: \"๐Ÿ‡บ๐Ÿ‡ธ\" },\n { value: \"UY\", label: \"Uruguay\", emoji: \"๐Ÿ‡บ๐Ÿ‡พ\" },\n { value: \"UZ\", label: \"Uzbekistan\", emoji: \"๐Ÿ‡บ๐Ÿ‡ฟ\" },\n { value: \"VA\", label: \"Holy See\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฆ\" },\n { value: \"VC\", label: \"Saint Vincent and the Grenadines\", emoji: \"๐Ÿ‡ป๐Ÿ‡จ\" },\n { value: \"VE\", label: \"Venezuela, Bolivarian Republic of\", emoji: \"๐Ÿ‡ป๐Ÿ‡ช\" },\n { value: \"VG\", label: \"Virgin Islands, British\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฌ\" },\n { value: \"VI\", label: \"Virgin Islands, U.S.\", emoji: \"๐Ÿ‡ป๐Ÿ‡ฎ\" },\n { value: \"VN\", label: \"Viet Nam\", emoji: \"๐Ÿ‡ป๐Ÿ‡ณ\" },\n { value: \"VU\", label: \"Vanuatu\", emoji: \"๐Ÿ‡ป๐Ÿ‡บ\" },\n { value: \"WF\", label: \"Wallis and Futuna\", emoji: \"๐Ÿ‡ผ๐Ÿ‡ซ\" },\n { value: \"WS\", label: \"Samoa\", emoji: \"๐Ÿ‡ผ๐Ÿ‡ธ\" },\n { value: \"YE\", label: \"Yemen\", emoji: \"๐Ÿ‡พ๐Ÿ‡ช\" },\n { value: \"YT\", label: \"Mayotte\", emoji: \"๐Ÿ‡พ๐Ÿ‡น\" },\n { value: \"ZA\", label: \"South Africa\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ฆ\" },\n { value: \"ZM\", label: \"Zambia\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ฒ\" },\n { value: \"ZW\", label: \"Zimbabwe\", emoji: \"๐Ÿ‡ฟ๐Ÿ‡ผ\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { useRef } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-links", "content": "\"use client\"\nexport const ComboboxWithLinks = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n selectionBehavior=\"clear\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n \n {item.label} \n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\", docs: \"https://react.dev\" },\n { label: \"Solid\", value: \"solid\", docs: \"https://solidjs.com\" },\n { label: \"Vue\", value: \"vue\", docs: \"https://vuejs.org\" },\n { label: \"Angular\", value: \"angular\", docs: \"https://angular.io\" },\n { label: \"Svelte\", value: \"svelte\", docs: \"https://svelte.dev\" },\n { label: \"Preact\", value: \"preact\", docs: \"https://preactjs.com\" },\n { label: \"Qwik\", value: \"qwik\", docs: \"https://qwik.builder.io\" },\n { label: \"Lit\", value: \"lit\", docs: \"https://lit.dev\" },\n { label: \"Alpine.js\", value: \"alpinejs\", docs: \"https://alpinejs.dev\" },\n { label: \"Ember\", value: \"ember\", docs: \"https://emberjs.com\" },\n { label: \"Next.js\", value: \"nextjs\", docs: \"https://nextjs.org\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"", "import { LuExternalLink } from \"react-icons/lu\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"", "npmDependencies": [ "react-icons" ] }, { "name": "combobox-with-multiple", "content": "\"use client\"\nconst skills = [\n \"JavaScript\",\n \"TypeScript\",\n \"React\",\n \"Node.js\",\n \"GraphQL\",\n \"PostgreSQL\",\n]\n\nexport const ComboboxWithMultiple = () => {\n const [searchValue, setSearchValue] = useState(\"\")\n const [selectedSkills, setSelectedSkills] = useState([])\n\n const filteredItems = useMemo(\n () =>\n skills.filter((item) =>\n item.toLowerCase().includes(searchValue.toLowerCase()),\n ),\n [searchValue],\n )\n\n const collection = useMemo(\n () => createListCollection({ items: filteredItems }),\n [filteredItems],\n )\n\n const handleValueChange = (details: Combobox.ValueChangeDetails) => {\n setSelectedSkills(details.value)\n }\n\n return (\n setSearchValue(details.inputValue)}\n >\n \n {selectedSkills.map((skill) => (\n {skill}\n ))}\n \n\n Select Skills\n\n \n \n \n \n \n \n\n \n \n \n \n Skills\n {filteredItems.map((item) => (\n \n {item}\n \n \n ))}\n No skills found\n \n \n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import {\n Badge,\n Combobox,\n Portal,\n Wrap,\n createListCollection,\n} from \"@chakra-ui/react\"", "import { useMemo, useState } from \"react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-option-group", "content": "\"use client\"\nexport const ComboboxWithOptionGroup = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n groupBy: (item) => item.type,\n })\n\n return (\n filter(e.inputValue)}\n width=\"320px\"\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.group().map(([group, items]) => (\n \n {group}\n \n {items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\", type: \"Frontend\" },\n { label: \"Node.js\", value: \"nodejs\", type: \"Backend\" },\n { label: \"Django\", value: \"django\", type: \"Backend\" },\n { label: \"Vue\", value: \"vue\", type: \"Frontend\" },\n { label: \"Svelte\", value: \"svelte\", type: \"Frontend\" },\n { label: \"Next.js\", value: \"nextjs\", type: \"Frontend\" },\n { label: \"Express\", value: \"express\", type: \"Backend\" },\n { label: \"Ruby on Rails\", value: \"rails\", type: \"Backend\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-positioning", "content": "\"use client\"\nexport const ComboboxWithPositioning = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n width=\"160px\"\n positioning={{ flip: false, gutter: 2, placement: \"right-start\" }}\n >\n Select framework\n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-selection-behavior", "content": "\"use client\"\nexport const ComboboxWithSelectionBehavior = () => {\n return (\n \n \n \n \n \n )\n}\n\nconst descriptions = {\n replace: \"Selected item replaces the input value\",\n clear: \"Input value is cleared after selection\",\n preserve: \"Input value is preserved after selection\",\n}\n\nconst ComboboxDemo = (props: Partial) => {\n const { selectionBehavior = \"replace\" } = props\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: companies,\n filter: contains,\n })\n\n return (\n \n \n {selectionBehavior} Selection\n \n {descriptions[selectionBehavior]}\n \n \n\n filter(details.inputValue)}\n >\n Select Companies\n\n \n \n \n\n \n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n )\n}\n\nconst companies = [\n { label: \"Apple\", value: \"apple\" },\n { label: \"Amazon\", value: \"amazon\" },\n { label: \"Meta\", value: \"meta\" },\n { label: \"Netflix\", value: \"netflix\" },\n { label: \"Google\", value: \"google\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Box,\n Combobox,\n Heading,\n Stack,\n Text,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-sizes", "content": "\"use client\"\nexport const ComboboxWithSizes = () => {\n return (\n \n \n \n \n \n \n )\n}\n\nconst ComboboxDemo = (props: Omit) => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n collection={collection}\n >\n \n Select framework ({props.size?.toString()})\n \n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n Stack,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-store", "content": "\"use client\"\nexport const ComboboxWithStore = () => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n const combobox = useCombobox({\n collection,\n onInputValueChange(e) {\n filter(e.inputValue)\n },\n })\n\n return (\n \n Select framework\n\n \n \n \n \n \n \n \n\n \n \n \n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n useCombobox,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" }, { "name": "combobox-with-variants", "content": "\"use client\"\nexport const ComboboxWithVariants = () => {\n return (\n \n \n \n \n \n )\n}\n\nconst ComboboxDemo = (props: Omit) => {\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const { collection, filter } = useListCollection({\n initialItems: frameworks,\n filter: contains,\n })\n\n return (\n filter(e.inputValue)}\n collection={collection}\n >\n \n Select framework ({props.variant?.toString()})\n \n \n \n \n \n \n \n \n \n \n \n No items found\n {collection.items.map((item) => (\n \n {item.label}\n \n \n ))}\n \n \n \n \n )\n}\n\nconst frameworks = [\n { label: \"React\", value: \"react\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Vue\", value: \"vue\" },\n { label: \"Angular\", value: \"angular\" },\n { label: \"Svelte\", value: \"svelte\" },\n { label: \"Preact\", value: \"preact\" },\n { label: \"Qwik\", value: \"qwik\" },\n { label: \"Lit\", value: \"lit\" },\n { label: \"Alpine.js\", value: \"alpinejs\" },\n { label: \"Ember\", value: \"ember\" },\n { label: \"Next.js\", value: \"nextjs\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n Combobox,\n Portal,\n Stack,\n useFilter,\n useListCollection,\n} from \"@chakra-ui/react\"" ], "importPath": "import { Combobox } from \"@chakra-ui/react\"" } ] }