Skip to content

Select

Select<FieldValues>(props): Element

Select components give users the ability to choose one or more options from a list of choices.

Type Parameters

Type Parameter
FieldValues extends Record<string, unknown>

Parameters

ParameterTypeDescription
propsobject
props.disabled?boolean-
props.error?objectAn error message that overrides errors produced by built-in validation.
props.error.messagestring-
props.helpText?ReactNode-
props.label?string-
props.namestring-
props.optionsundefined | OptionsOrGroups<unknown, GroupBase<unknown>>-
props.required?boolean-

Returns

Element

See

Form

Example

import { Select } from "@netlify/sdk/react/components";
<Select
label="Your Favorite Dog"
name="favoriteDog"
options={[
{ label: "Corgi", value: "corgi" },
{ label: "Golden Retriever", value: "golden-retriever" },
{ label: "Pomeranian", value: "pomeranian" },
]}
required
/>