textarea
The textarea
property is used to define a plain text value. This is functionally similar to the text property but is displayed as a textarea in the admin, allowing for more space for the user to enter text.
import { atom, textarea } from '@iridiumcms/core';
export const sample = atom('sample', {
myText: textarea(),
});
Configuration
The textarea
field takes an optional configuration object with the following properties:
- minLengthThe minimum length of the field. Defaults to
number
0
. - maxLengthThe maximum length of the field. Defaults to
number
Infinity
. - defaultValueThe default value of the field. Defaults to
string
undefined
. - displayNameThe display name of the field. Defaults to the name of the property.
string
- requiredWhether the field is required. Defaults to
boolean
false
. - searchableWhether the field is searchable. Defaults to
boolean
false
. - filterableAllows filtering the field. Defaults to
boolean
false
. - layoutThe layout of the field in the admin. Defaults to
LAYOUT
LAYOUT.full
. - placeholderThe input placeholder text in the admin. Defaults to
string
undefined
. - patternA regular expression pattern that the field value must match. Defaults to
RegExp
undefined
.