Code
The code input is identical to the text input, but it uses a monospace font to display the content.
Example
{ type: "code", label: "Code" }Options
Input
Use these options when using the field with take.
key? | A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values. |
label? | A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group. |
detail? | Additional information about the field, disclosed in a tooltip. |
required? | Whether or not this field is required. |
value? | The initial value of the field. |
placeholder? | Add placeholder text to prompt the user when the field is empty. |
spellcheck? | Enable or disable the browser’s spellchecking feature. |
pattern? | A regular expression that the input value must match in order for the value to pass validation. |
maxlength? | The maximum number of characters the user can enter into the input. |
autocorrect? | Enable or disable the browser’s autocorrecting feature. When spellcheck is false, the default value is "off". See MDN for more details. |
autocapitalize? | Enable or disable the browser’s autocapitalizing feature. When spellcheck is false, the default value is "off". See MDN for more details. |
Output
Use these options when using the field with make.
label? | A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group. |
detail? | Additional information about the field, disclosed in a tooltip. |
value? | The output value of the field. |
Data
Code will always return a string. If the value is null or undefined, an empty string is returned. All other non-string values have their toString() method called before being parsed.