Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netlify_cms_config/fields/select.ts>default

Netlify CMS config generator
Latest
class default
extends Field<Options>
import { default } from "https://deno.land/x/netlify_cms_config@v0.3.2/fields/select.ts";

Constructors

new
default(label: string, config?: Options)

Properties

widget: string

Methods

default(value: string | Option): this

Options must contain any default values

  • String values: accepts a string; defaults to an empty string. Accepts an array of strings and defaults to an empty array with multiple: true enabled.
  • Object with label and value fields: accepts an object with label and value field or an array of such objects when multiple: true is enable. Defaults to no value
max(value: number): this

Maximum number of items. Ignored if multiple is false

min(value: number): this

Minimum number of items. Ignored if multiple is false

multiple(value?): this

Defaults to false

options(value: Option[]): this

There are two ways to list of options for the dropdown menu:

  • String values: the dropdown displays the value directly
  • Object with label and value fields: the label displays in the dropdown; the value saves in the file