Combobox
An input combined with a list of predefined items to select.
Installation
pnpm dlx shadcn@latest add @lumi-ui/combobox
Anatomy
<Combobox>
<ComboboxTrigger />
<ComboboxInputGroup />
<ComboboxChips>
<ComboboxChip />
</ComboboxChips>
<ComboboxContent>
<ComboboxStatus />
<ComboboxEmpty />
<ComboboxList>
<ComboboxRow>
<ComboboxItemContent />
</ComboboxRow>
<ComboboxSeparator />
<ComboboxGroup>
<ComboboxGroupLabel />
</ComboboxGroup>
<ComboboxCollection />
</ComboboxList>
</ComboboxContent>
</Combobox>Features
With Clear Button, Trigger Button and Icon
Input Inside Popup
Use ComboboxTrigger instead of ComboboxInputGroup to place the input inside the popup. Apply variant="ghost" on ComboboxInput to remove the border and focus state.
Change Indicator Icon and Position
Grouped
positionerAnchor
By default, the ComboboxContent anchors itself to the ComboboxTrigger. To make the popup match the width of the outer container, manually set that container as the anchor.
Cookbook
With Scroll Area
Multiple Selection
Creatable
Async Items (Single)
Async Items (Multiple)
Customization
Form Integration
API Reference
ComboboxInputGroup
A high-level input component that combines the ComboboxInput, Icon ,ComboboxClear, and ComboboxTrigger into a single styled element.
ComboboxContent
A high-level container component that combines the ComboboxPortal, ComboboxPositioner, and ComboboxPopup into a single styled element for the dropdown content.
ComboboxItemContent
A high-level item component that combines the Item and ItemIndicator into a single styled element with configurable icon positioning.