Type to narrow the list, then choose an option. Selection is single by default; set multiple to work with chips.
Next.js
SvelteKit
Nuxt.js
Remix
Astro
tsx
1import{2Combobox,3ComboboxContent,4ComboboxEmpty,5ComboboxInput,6ComboboxItem,7ComboboxList,8}from"@/components/ui/combobox"910constframeworks=["Next.js","SvelteKit","Nuxt.js","Remix","Astro"]1112exportfunctionExample(){13return(14<Combobox>15<ComboboxInputplaceholder="Select a framework"/>16<ComboboxContent>17<ComboboxEmpty>No frameworks found.</ComboboxEmpty>18<ComboboxList>19{frameworks.map((framework)=>(20<ComboboxItemkey={framework}value={framework}>21{framework}22</ComboboxItem>23))}24</ComboboxList>25</ComboboxContent>26</Combobox>27)28}
1<Combobox>2<ComboboxInputplaceholder="Pick a workspace"/>3<ComboboxContent>4<ComboboxEmpty>No workspaces found.</ComboboxEmpty>5<ComboboxList>6<ComboboxItemvalue="design">Design</ComboboxItem>7<ComboboxItemvalue="docs">Docs</ComboboxItem>8</ComboboxList>9</ComboboxContent>10</Combobox>
A single field with a flat list that filters as you type.
Next.js
SvelteKit
Nuxt.js
Remix
Astro
tsx
1import{2Combobox,3ComboboxContent,4ComboboxEmpty,5ComboboxInput,6ComboboxItem,7ComboboxList,8}from"@/components/ui/combobox"910constframeworks=["Next.js","SvelteKit","Nuxt.js","Remix","Astro"]1112exportfunctionExample(){13return(14<Combobox>15<ComboboxInputplaceholder="Select a framework"/>16<ComboboxContent>17<ComboboxEmpty>No frameworks found.</ComboboxEmpty>18<ComboboxList>19{frameworks.map((framework)=>(20<ComboboxItemkey={framework}value={framework}>21{framework}22</ComboboxItem>23))}24</ComboboxList>25</ComboboxContent>26</Combobox>27)28}
With icon
Pass a leading icon with startAddon. Add startAddonAlways to keep it visible when the list is closed.
Pass showClear to add a clear control to the input.
Next.js
SvelteKit
Nuxt.js
Remix
Astro
tsx
1import{2Combobox,3ComboboxContent,4ComboboxEmpty,5ComboboxInput,6ComboboxItem,7ComboboxList,8}from"@/components/ui/combobox"910constframeworks=["Next.js","SvelteKit","Nuxt.js","Remix","Astro"]1112exportfunctionExample(){13return(14<ComboboxdefaultValue="Next.js"showClear>15<ComboboxInputplaceholder="Select a framework"/>16<ComboboxContent>17<ComboboxEmpty>No frameworks found.</ComboboxEmpty>18<ComboboxList>19{frameworks.map((framework)=>(20<ComboboxItemkey={framework}value={framework}>21{framework}22</ComboboxItem>23))}24</ComboboxList>25</ComboboxContent>26</Combobox>27)28}
Groups
Organize longer lists with ComboboxGroup, ComboboxLabel, and ComboboxSeparator.
Set invalid on the root to apply the destructive border treatment.
pnpm
npm
yarn
bun
tsx
1import{2Combobox,3ComboboxContent,4ComboboxEmpty,5ComboboxInput,6ComboboxItem,7ComboboxList,8}from"@/components/ui/combobox"910exportfunctionExample(){11return(12<ComboboxinvaliddefaultValue="npm"showClear>13<ComboboxInputplaceholder="Pick a package manager"/>14<ComboboxContent>15<ComboboxEmpty>No matches.</ComboboxEmpty>16<ComboboxList>17<ComboboxItemvalue="pnpm">pnpm</ComboboxItem>18<ComboboxItemvalue="npm">npm</ComboboxItem>19<ComboboxItemvalue="yarn">yarn</ComboboxItem>20<ComboboxItemvalue="bun">bun</ComboboxItem>21</ComboboxList>22</ComboboxContent>23</Combobox>24)25}
Disabled
Set disabled to make the field and its list unavailable.
Next.js
Remix
tsx
1import{2Combobox,3ComboboxContent,4ComboboxEmpty,5ComboboxInput,6ComboboxItem,7ComboboxList,8}from"@/components/ui/combobox"910exportfunctionExample(){11return(12<ComboboxdisableddefaultValue="Next.js">13<ComboboxInputplaceholder="Select a framework"/>14<ComboboxContent>15<ComboboxEmpty>No frameworks found.</ComboboxEmpty>16<ComboboxList>17<ComboboxItemvalue="Next.js">Next.js</ComboboxItem>18<ComboboxItemvalue="Remix">Remix</ComboboxItem>19</ComboboxList>20</ComboboxContent>21</Combobox>22)23}
Popup
Use ComboboxTrigger to open the list from a button, with the search field inside the panel.