Combobox

Autocomplete input and command palette with a list of suggestions.

Installation

npx love-ui@latest add combobox

Usage

import { Combobox, ComboboxTrigger, ComboboxContent, ComboboxInput, ComboboxList, ComboboxEmpty, ComboboxGroup, ComboboxItem } from "@/components/combobox"
<Combobox>
  <ComboboxTrigger>Select option...</ComboboxTrigger>
  <ComboboxContent>
    <ComboboxInput placeholder="Search..." />
    <ComboboxList>
      <ComboboxEmpty>No results found.</ComboboxEmpty>
      <ComboboxGroup>
        <ComboboxItem value="option1">Option 1</ComboboxItem>
        <ComboboxItem value="option2">Option 2</ComboboxItem>
        <ComboboxItem value="option3">Option 3</ComboboxItem>
      </ComboboxGroup>
    </ComboboxList>
  </ComboboxContent>
</Combobox>

Features

  • Autocomplete input with dropdown list of suggestions
  • Controlled and uncontrolled modes
  • Customizable trigger button
  • Search functionality
  • Empty state handling
  • Responsive width that matches the trigger
  • Keyboard navigation support
  • Grouping of items
  • Context-based type labeling
  • Native "create new" functionality

Examples

Controlled version

Fixed width

Create new items