Dropdown

The dropdown can be used to select an option from a predefined list.

Example

({
  type: "dropdown",
  options: ["Option 1", "Option 2"],
  label: "Dropdown",
})

Options

Input

Use these options when using the field with take.

options
Array<string>|‌Array<object>
Set the options that are available. Options may be an array of strings or an array of objects with label and value properties.
value?
number
The index of the options item to use as the initial value of the field.
key?
string
A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values.
label?
string
A label describing the purpose of the field.
detail?
string
Additional information about the field, disclosed in a tooltip.

Data

A dropdown always returns a string value matching one of the options declared, or the value defined by the object in the options list.