Text
A text field holds a plain string: a name, a short description, a label. Use rich text when editors need formatting or links.
import {Field} from 'alinea'
Field.text('Summary', {
help: 'Shown on overview pages',
multiline: true,
searchable: true
})Options
multiline: allow line breaks, the field is shown as a text area. Defaultfalse.placeholder: a short hint shown while the field is empty.type: the input type, one of'text'(default),'email','tel'or'url'. It changes the keyboard on mobile devices and is ignored for multiline fields. It doesn't validate the value, usevalidatefor that.searchable: add the value to the search index, sosearchqueries also match on it. See Search.iconLeftandiconRight: an icon component shown inside the input, before or after the text.autoFocus: focus the input when the entry opens.The common options:
help,width,inline,initialValue,required,validate,readOnly,hiddenandshared.
Value
The field stores a string and queries return it as is. New entries start with an empty string (''), not undefined, unless you set an initialValue. Line breaks in a multiline field are stored as \n: render them with white-space: pre-line or split on them.
Single-line text fields are shown as a column when an entry's children are listed in the dashboard's overview.