Overview
String Schema
s.string()
Use the s.string() schema to represent text. Use .multiline() when the value can hold line breaks, and s.code({ language }) when it holds source code.
Methods:
.validate: method
Custom validation function
.maxLength(n): method
Maximum length validation
.minLength(n): method
Minimum length validation
.regex(pattern): method
Regex pattern validation
s.string().regex(/Example/)
.multiline(): method
Let the string hold line breaks. The field becomes a growing text box instead of a single-line input.
For strings that hold source code or configuration, use s.code() instead - a language is part of what the value is, not how the field is drawn.