Skip to content
Strife Docs

Reference Field Reference

fields.multiSelect()

Deprecated: use fields.select({ multiple: true }), which compiles to the same field and stores the same array of values.

Warning:

Deprecated since @strifeapp/schema 0.21. Use fields.select({ multiple: true }) — multiSelect() now compiles to exactly that.

Multiple-choice selection, stored as a plain array of the chosen value strings, in the order the options are declared.

Up to 0.20 it compiled to the Multi Select editor (str-multi-select). From 0.21 it compiles to { name: 'str-select', type: 'select' } with attributes.multiple: true. The stored shape is the same, so existing documents need nothing; only the template's editor changes on your next strife push.

Example

TypeScript
fields.multiSelect({
  label: 'Tags',
  options: [
    { name: 'News', value: 'news' },
    { name: 'Product', value: 'product' },
  ] as const,
})
// same as fields.select({ label: 'Tags', multiple: true, options: [...] as const })
// _output: ('news' | 'product')[]

Options

The options of fields.select(), without multiple (always on).

Output type

O[number]['value'][] — the array of chosen option-value literals.

See also