Black Friday · Save 40% on Intent UI Design licenses with code UI2026.· 4 days left

Combo Box

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/combo-box

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Install the dependencies, then copy the component source into your project.

npm install react-aria-components @heroicons/react

Anatomy

import { Label } from "@/components/ui/field"
import {
  ComboBox,
  ComboBoxInput,
  ComboBoxContent,
  ComboBoxItem,
} from "@/components/ui/combo-box"
<ComboBox name="users">
  <Label>Users</Label>
  <ComboBoxInput placeholder="Select a user" />
  <ComboBoxContent>
    <ComboBoxItem>John Lennon</ComboBoxItem>
    <ComboBoxItem>Paul McCartney</ComboBoxItem>
    <ComboBoxItem>George Harrison</ComboBoxItem>
    <ComboBoxItem>Ringo Starr</ComboBoxItem>
  </ComboBoxContent>
</ComboBox>

Examples

Using avatars

The combo box can be configured to display avatars instead of just regular text.

Loading...

Section

A combo box can display items grouped together in sections.

Loading...

Readonly

When the combo box is in a readonly state, it cannot be edited.

Loading...

Label

If the children of a ComboBoxItem is a string, the ComboBoxLabel will automatically wrap it. However, if you're including additional elements like an icon or avatar, you'll need to manually wrap the label, as shown below:

<ComboBoxItem id={item.id} textValue={item.name}>
  <Avatar src={item.image_url} />
  <ComboBoxLabel>{item.name}</ComboBoxLabel>
</ComboBoxItem>

Details description

If you need to provide more information about an option, use the ComboBoxDescription component to display additional details.

Loading...

Validation

If a user submits the form without selecting an item, an error message will appear.

Loading...

Controlled

Control the input text with inputValue and onInputChange, or control the selected item with selectedKey and onSelectionChange.

onInputChange receives the input text, including text typed before an option is selected. onSelectionChange receives the selected item’s key.

Input

Pass inputValue and update it with onInputChange.

Loading...

Selection

Pass selectedKey and update it with onSelectionChange.

Loading...

Multiple select

Set selectionMode="multiple" to allow multi-select, and use TagGroup to display the selected items.

Loading...

Custom value

Set allowsCustomValue to allow input that does not match a listed option.

Loading...

Disabled

When the combo box is disabled, it becomes non-interactive and cannot be edited.

Loading...

Component API

ComboBox

ComboBox extends the React Aria Components <ComboBox> component.

classNamestring

ComboBoxContent

ComboBoxContent extends the React Aria Components <ListBox> component.

classNamestring
popoverOmit<PopoverProps, "children">

ComboBoxInput

ComboBoxInput extends the React Aria Components <Input> component.

classNamestring

ComboBoxValue

ComboBoxValue extends the React Aria Components <ComboBoxValue> component.

classNamestring

ComboBoxItem

ComboBoxItem extends the Intent UI <DropdownItem> component.

classNamestring
intent"danger" | "warning"

ComboBoxLabel

ComboBoxLabel extends the Intent UI <DropdownLabel> component.

classNamestring

ComboBoxDescription

ComboBoxDescription extends the Intent UI <DropdownDescription> component.

classNamestring

ComboBoxSection

ComboBoxSection extends the Intent UI <DropdownSection> component.

classNamestring
titlestring

See the React Aria for the full API reference.

Design