Combobox

Select from a list of options with a search input.

Preview

Select an option from the list

Usage

import { z } from "zod";
import { AutoForm } from "@vitnode/core/components/form/auto-form";
import { AutoFormCombobox } from "@vitnode/core/components/form/fields/combobox";
const formSchema = z.object({
  type: z.enum(["option-one", "option-two"]),
});
<AutoForm
  formSchema={formSchema}
  fields={[
    {
      id: "type",
      component: props => (
        <AutoFormCombobox
          {...props}
          description="Select an option from the list"
          label="Type"
          labels={[
            {
              value: "option-one",
              label: "Option One",
            },
            {
              value: "option-two",
              label: "Option Two",
            },
          ]}
        />
      ),
    },
  ]}
/>

Props

Prop

Type

On this page