Combobox
An input that filters a list of options.
Upstream documentationExamples
Installation
Run the Ninaero registry command to install the component and its dependencies, including shared theme styles.
Install Combobox
pnpm dlx shadcn@latest add 'https://ninaero.pages.dev/r/combobox.json'Usage
A complete example using the installed component and hook paths.
Combobox usage
"use client";import { useId } from "react";import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList } from "@/components/ui/combobox";import { Label } from "@/components/ui/label";function ComboboxPreview() { const id = useId(); return ( <div className="w-full max-w-64 space-y-2"> <Label htmlFor={id}>Fruit</Label> <Combobox items={["Apple", "Banana", "Cherry"]}> <ComboboxInput id={id} placeholder="Choose a fruit" /> <ComboboxContent> <ComboboxEmpty>No matching fruit</ComboboxEmpty> <ComboboxList> {(fruit: string) => ( <ComboboxItem key={fruit} value={fruit}> {fruit} </ComboboxItem> )} </ComboboxList> </ComboboxContent> </Combobox> </div> );}export default function Demo() { return <ComboboxPreview />;}API Reference
Ninaero exports and local defaults are listed below. See the upstream reference for inherited primitive props and additional composition examples.
Combobox
Combobox props
ComboboxPrimitive.Root.Props<Value, Multiple, Item> & { sound?: boolean }- sound
- true
ComboboxInput
ComboboxInput props
ComboboxPrimitive.Input.Props & { showTrigger?: boolean; showClear?: boolean;}- disabled
- false
- showTrigger
- true
- showClear
- false
ComboboxContent
ComboboxContent props
ComboboxPrimitive.Popup.Props & Pick< ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" >- side
- "bottom"
- sideOffset
- 6
- align
- "start"
- alignOffset
- 0
ComboboxList
ComboboxList props
ComboboxPrimitive.List.PropsComboboxItem
ComboboxItem props
ComboboxPrimitive.Item.PropsComboboxGroup
ComboboxGroup props
ComboboxPrimitive.Group.PropsComboboxLabel
ComboboxLabel props
ComboboxPrimitive.GroupLabel.PropsComboboxCollection
ComboboxCollection props
ComboboxPrimitive.Collection.PropsComboboxEmpty
ComboboxEmpty props
ComboboxPrimitive.Empty.PropsComboboxSeparator
ComboboxSeparator props
ComboboxPrimitive.Separator.PropsComboboxChips
ComboboxChips props
React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.PropsComboboxChip
ComboboxChip props
ComboboxPrimitive.Chip.Props & { showRemove?: boolean;}- showRemove
- true
ComboboxChipsInput
ComboboxChipsInput props
ComboboxPrimitive.Input.PropsComboboxTrigger
ComboboxTrigger props
ComboboxPrimitive.Trigger.Props & { sound?: boolean }- sound
- true
ComboboxValue
ComboboxValue props
ComboboxPrimitive.Value.PropsuseComboboxAnchor
Re-exported primitive; see the upstream API reference.