Select
Choose an option from a list of options.
Preview
Usage
import { z } from "zod";
import { AutoForm } from "@vitnode/core/components/form/auto-form";
import { AutoFormSelect } from "@vitnode/core/components/form/fields/select";const formSchema = z.object({
options: z.enum(["option1", "option2", "option3"]).default("option1"),
});<AutoForm
formSchema={formSchema}
fields={[
{
id: "options",
component: props => (
<AutoFormSelect
{...props}
description="Choose one of the options."
label="Select an option"
labels={[
{
value: "option1",
label: "Option 1",
},
{
value: "option2",
label: "Option 2",
},
{
value: "option3",
label: "Option 3",
},
]}
/>
),
},
]}
/>Props
Prop
Type