text
The text property is used to define a plain text value.
import { atom, text } from '@iridiumcms/core';
export const sample = atom('sample', {
myText: text(),
});
Configuration
The text field takes an optional configuration object with the following properties:
- minLengthThe minimum length of the field. Defaults to
number0. - maxLengthThe maximum length of the field. Defaults to
numberInfinity. - defaultValueThe default value of the field. Defaults to
stringundefined. - displayNameThe display name of the field. Defaults to the name of the property.
string - requiredWhether the field is required. Defaults to
booleanfalse. - searchableWhether the field is searchable. Defaults to
booleanfalse. - filterableAllows filtering the field. Defaults to
booleanfalse. - layoutThe layout of the field in the admin. Defaults to
LAYOUTLAYOUT.full. - placeholderThe input placeholder text in the admin. Defaults to
stringundefined. - patternA regular expression pattern that the field value must match. Defaults to
RegExpundefined.
