NovaUI
Components

Combobox

A searchable dropdown selector that combines a text input with a filterable list of options.

The Combobox component combines a trigger button with a searchable popup list. It supports single selection, search filtering, groups with headings, and customizable items with check indicators. Built with React Native's Modal, TextInput, and ScrollView.

Preview

Installation

npx novaui-cli add combobox

Import

import {
  Combobox,
  ComboboxTrigger,
  ComboboxContent,
  ComboboxInput,
  ComboboxList,
  ComboboxEmpty,
  ComboboxGroup,
  ComboboxItem,
  ComboboxSeparator,
} from 'novaui-components'

Basic Usage

Search framework...
React
Vue
Angular
Svelte
import { useState } from 'react'
import {
  Combobox,
  ComboboxTrigger,
  ComboboxContent,
  ComboboxInput,
  ComboboxList,
  ComboboxEmpty,
  ComboboxItem,
} from 'novaui-components'
import { Text } from 'react-native'

const frameworks = [
  { value: 'react', label: 'React' },
  { value: 'vue', label: 'Vue' },
  { value: 'angular', label: 'Angular' },
  { value: 'svelte', label: 'Svelte' },
]

export function BasicCombobox() {
  const [value, setValue] = useState<string>('react')

  return (
    <Combobox value={value} onValueChange={setValue}>
      <ComboboxTrigger>
        <Text className="text-sm text-foreground">
          {frameworks.find((f) => f.value === value)?.label ?? 'Select a framework...'}
        </Text>
      </ComboboxTrigger>
      <ComboboxContent>
        <ComboboxInput placeholder="Search framework..." />
        <ComboboxList>
          <ComboboxEmpty>No framework found.</ComboboxEmpty>
          {frameworks.map((f) => (
            <ComboboxItem key={f.value} value={f.value} label={f.label}>
              {f.label}
            </ComboboxItem>
          ))}
        </ComboboxList>
      </ComboboxContent>
    </Combobox>
  )
}

With Groups

Search...
Frontend
React
Vue
Backend
Express
Fastify
<Combobox value={value} onValueChange={setValue}>
  <ComboboxTrigger>
    <Text className="text-sm text-foreground">
      {selectedLabel ?? 'Select...'}
    </Text>
  </ComboboxTrigger>
  <ComboboxContent>
    <ComboboxInput placeholder="Search..." />
    <ComboboxList>
      <ComboboxEmpty>No results found.</ComboboxEmpty>
      <ComboboxGroup heading="Frontend">
        <ComboboxItem value="react" label="React">React</ComboboxItem>
        <ComboboxItem value="vue" label="Vue">Vue</ComboboxItem>
      </ComboboxGroup>
      <ComboboxSeparator />
      <ComboboxGroup heading="Backend">
        <ComboboxItem value="express" label="Express">Express</ComboboxItem>
        <ComboboxItem value="fastify" label="Fastify">Fastify</ComboboxItem>
      </ComboboxGroup>
    </ComboboxList>
  </ComboboxContent>
</Combobox>

Props API

Combobox

Extends React.ComponentPropsWithoutRef<typeof View>:

PropTypeDefaultDescription
valuestring | string[]-The selected value(s)
onValueChange(value: string | string[]) => void-Callback when the selection changes
defaultOpenbooleanfalseWhether the content is initially open
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Callback when open state changes
classNamestring-Additional CSS classes

ComboboxTrigger

Extends React.ComponentPropsWithoutRef<typeof Pressable>:

PropTypeDefaultDescription
asChildbooleanfalseRender as the child element
classNamestring-Additional CSS classes

ComboboxContent

Extends React.ComponentPropsWithoutRef<typeof View>:

PropTypeDefaultDescription
classNamestring-Additional CSS classes

ComboboxInput

Extends React.ComponentPropsWithoutRef<typeof TextInput>:

PropTypeDefaultDescription
classNamestring-Additional CSS classes

ComboboxList

Extends React.ComponentPropsWithoutRef<typeof ScrollView>:

PropTypeDefaultDescription
classNamestring-Additional CSS classes

ComboboxGroup

PropTypeDefaultDescription
headingstring-Group heading text
classNamestring-Additional CSS classes

ComboboxItem

Extends React.ComponentPropsWithoutRef<typeof Pressable>:

PropTypeDefaultDescription
valuestringrequiredThe value of the item
labelstringrequiredLabel used for search filtering
classNamestring-Additional CSS classes

Best Practices

  1. Always include search: The search input is the core advantage over a plain Select
  2. Provide an empty state: Use ComboboxEmpty to show a message when no items match the search
  3. Use groups for large lists: Organize items into ComboboxGroup with headings
  4. Set label for filtering: The label prop on ComboboxItem controls search matching
  5. Close on select: Items automatically close the combobox and clear the search on selection
  • Select - For simple dropdown selection without search
  • Command - For a command palette with broader action support
  • Input - For free-text entry

On this page