Skip to content
Cojeev UI

Combobox

Forms

Filters a list of options through text input and stores one selected value.

React · copy into your project · light and dark themes

Try it

Loading preview…

Take it with you

Copy the example, API and usage notes for your editor or AI assistant.

Add to your project

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/combobox.json

The command includes the component’s shared dependencies. Your project keeps editable source files.

Include the complete example

This example also composes typography. Install its parts together:

Terminal
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/combobox.json https://luv-jeri.github.io/cojeev-ui/r/typography.json

Using combobox

  • Items show stable, varied blob adornments by default. Set adornment={false} to hide, supply {shape,color,icon,effect}, or pass a custom icon element.

  • Provide options with distinct values and readable labels for the built-in input, results, and empty state.

  • Use value and onValueChange to store the selection, or compose the input and item parts for custom option content.

  • ComboboxItem shows a persistent selected check separately from hover or keyboard emphasis. Set showIndicator=false to suppress that mark.

API

Compose the exported parts below. The prop types are read from the React source during the registry build.

Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.

ComboboxProps

PropTypeRequired
aria-label

Defines a string value that labels the current element.

string | undefinedNo
valuestringNo
defaultValuestringNo
onValueChange(value: string) => voidNo
openbooleanNo
defaultOpenbooleanNo
onOpenChange(open: boolean) => voidNo
optionsComboboxOption[]No
placeholderstringNo
emptyTextstringNo

ComboboxInputProps

PropTypeRequired
wrapperPropsReact.ComponentProps<typeof InputWrapper>No
leadingReact.ReactNodeNo

ComboboxContentProps

Accepts the native or primitive props declared by its exported TypeScript type.

ComboboxItemProps

PropTypeRequired
labelstringNo
showIndicatorbooleanNo

ComboboxEmptyProps

Accepts the native or primitive props declared by its exported TypeScript type.

ComboboxGroupProps

Accepts the native or primitive props declared by its exported TypeScript type.

Accessibility

  • Supply a specific aria-label for the input and preserve the input, list, and item parts that coordinate focus and selection.

  • Write a useful emptyText message when a search has no matching option.

States and appearance

openresthoverfocusactive

For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.

Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.