method

TextListField.Default

Set the initial list.

Example

go
field.TextList("tags").Default("new", "sale")

Arguments

ArgumentTypeDescription
values[]stringInitial items, in order. With no arguments, the default is an empty list.

Returns

The updated TextListField; the original field is unchanged.

TextListField

How it works

Items are copied and must satisfy item and count constraints. This replaces any DefaultFrom callback.

Defaults fill eligible omissions; explicit null and [] are not replaced.

Full signature

Related types

Related guides