Multiselect field
Interests
The multiselect
field is similar to the select field but allows you to select zero, one or multiple options.
In the Admin UI, it renders a checkbox for each option.
You can optionally define defaultValue
as an array of values matching the option
values.
Usage example
multi: fields.multiselect({
label: 'Interests',
options: [
{ label: 'Surfing', value: 'surfing' },
{ label: 'Basketball', value: 'basketball' },
{ label: 'Music', value: 'music' },
{ label: 'Chess', value: 'chess' },
],
defaultValue: ['surfing', 'basketball', 'music'],
}),
Type signature
Find the latest version of this field's type signature at: https://docsmill.dev/npm/@keystatic/core@latest#/.fields.multiselect