Volt UI
ComponentsField

Field Combobox

A Combobox is a form control that allows the user to select a value from a list of options.

Basic Usage

A Combobox is a form control that allows the user to select a value from a list of options.

import { Field, FieldLabel, FieldCombobox, FieldComboboxTrigger, FieldComboboxValue, FieldComboboxContent, FieldComboboxInput, FieldComboboxList, FieldComboboxEmpty, FieldComboboxGroup, FieldComboboxGroupLabel, FieldComboboxItem, FieldComboboxSeparator, FieldComboboxLoading, Spinner } from "@epilot/volt-ui"

<Field variant="highlight">
  <FieldLabel>Items</FieldLabel>
  <FieldCombobox>
    <FieldComboboxTrigger>
      <FieldComboboxValue placeholder="Select an item">
        {value.label}
      </FieldComboboxValue>
    </FieldComboboxTrigger>
    <FieldComboboxContent className="max-h-56">
      <FieldComboboxInput placeholder="Search items" />
      <FieldComboboxLoading>
        <Spinner />
      </FieldComboboxLoading>
      <FieldComboboxList>
        <FieldComboboxEmpty>No items found</FieldComboboxEmpty>
        <FieldComboboxGroup>
          <FieldComboboxGroupLabel>List</FieldComboboxGroupLabel>
          <FieldComboboxItem value="1">1</FieldComboboxItem>
          <FieldComboboxItem value="2">2</FieldComboboxItem>
          <FieldComboboxItem value="3">3</FieldComboboxItem>
        </FieldComboboxGroup>
        
      </FieldComboboxList>
    </FieldComboboxContent>
  </FieldCombobox>
</Field>

Field Combobox Multi Select

A Combobox can be used to select multiple values from a list of options.

Refer FieldComboboxMultiSelectExample component to see how implement multi select combobox.

API Reference

FieldCombobox

Root component built on Radix Popover.Root. It controls the open state of the dropdown content.

PropTypeDefaultDescription
openboolean-Controlled open state of the combobox.
defaultOpenbooleanfalseWhether the combobox is open on initial render.
onOpenChange(open: boolean) => void-Invoked when the popover opens or closes.
modalbooleanfalseIf true, focus is trapped inside the popover.

FieldComboboxTrigger

Button that toggles the popover and syncs its ref with the surrounding Field for accessibility. Accepts every Radix Popover.Trigger prop.

PropTypeDefaultDescription
asChildbooleanfalseRender the trigger as its child component.
disabledbooleanfalseDisable pointer and keyboard interaction.
classNamestring-Extend the default Tailwind classes.

FieldComboboxValue

Displays either custom children (e.g., selected text) or a placeholder.

PropTypeDefaultDescription
placeholderstringrequiredText shown when no value is provided.
childrenReactNode-Optional custom label to display.
classNamestring-Extend typography or layout classes.

FieldComboboxContent

Popover surface that wraps the internal Command instance.

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""bottom"Preferred side to render against the trigger.
align"start" | "center" | "end""center"Horizontal alignment relative to the trigger.
sideOffsetnumber4Gap between trigger and content.
classNamestring-Customize the popover container.

FieldComboboxInput

Search field that filters the command list. Accepts all CommandInput props.

PropTypeDefaultDescription
placeholderstring"Search..."Hint text shown inside the input.
valuestring-Controlled search query.
onValueChange(value: string) => void-Fired whenever the query changes.
classNamestring-Extend the input styling.

FieldComboboxPlaceholder

Subtle text helper rendered within the value slot when no selection exists. Renders a plain span.

PropTypeDefaultDescription
classNamestring-Customize typography or spacing.

FieldComboboxLoading

Loading state that shows when the combobox is loading. Accepts CommandLoading props.

PropTypeDefaultDescription
childrenReactNode-Content displayed when the list is loading.
classNamestring-Customize spacing or typography.

FieldComboboxList

Scrollable container for list items. Accepts CommandList props.

PropTypeDefaultDescription
classNamestring-Adjust padding or height of the list.

FieldComboboxGroup

Wraps related items together. Accepts CommandGroup props.

PropTypeDefaultDescription
headingstring-Accessible text describing the group.
classNamestring-Customize spacing or typography.

FieldComboboxGroupLabel

Label rendered above a group. Built on the shared Label component.

PropTypeDefaultDescription
childrenReactNode-Text shown inside the label.
classNamestring-Extend the preset label classes.

FieldComboboxItem

Selectable row that uses CommandItem under the hood.

PropTypeDefaultDescription
valuestringrequiredMachine-friendly value emitted on selection.
disabledbooleanfalsePrevents hover/selection behavior.
classNamestring-Extend hover/active styles.
childrenReactNode-Label rendered inside the row.

FieldComboboxItemCheckIcon

Utility component that renders the checkmark indicator and can be placed inside custom items.

PropTypeDefaultDescription
classNamestring-Customize icon size or color.

FieldComboboxEmpty

Message shown when the query has no matches. Accepts CommandEmpty props.

PropTypeDefaultDescription
childrenReactNode-Content displayed when the list is empty.
classNamestring-Adjust typography or spacing.

FieldComboboxSeparator

Renders a thin divider between sections. Accepts CommandSeparator props.

PropTypeDefaultDescription
classNamestring-Customize spacing or color of the separator.

FieldComboboxTriggerClear

To clear the current selection.

PropTypeDefaultDescription
classNamestring-Customize spacing or color of the clear button.
onClick(event: React.MouseEvent<HTMLSpanElement>) => void-Fired after propagation is stopped to avoid closing the combobox.