0.0.2 • Published 2 years ago

ez-aem-jsonforms-react-spectrum-renderers v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

JSONForms - More Forms. Less Code

Complex Forms in the blink of an eye

JSONForms eliminates the tedious task of writing fully-featured forms by hand by leveraging the capabilities of JSON, JSON Schema and Javascript.

Spectrum Renderers Package

See how you can use the Spectrum renderers to render your forms.

Grid Array Control

UI Schema and Custom options

{
  "type": "Control",
  "scope": "#/properties/myArray",
  "options": {
    "addButtonLabel": "Add item",
    "addButtonLabelType": "tooltip",
    "addButtonPosition": "top"
  }
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"addButtonLabel"no"Add to \${label}"StringCustom add Button Label.
"addButtonLabelType"no"tooltip""tooltip" or "inline"Whether the Label should be inline or as tooltip.
"addButtonPosition"no"top""top" or "bottom"Position of the add Button.

Table Array Control

React Spectrum TableView

UI Schema and Custom options

{
  "type": "Control",
  "scope": "#/properties/myTable",
  "options": {
    "addButtonLabel": "Add item",
    "addButtonLabelType": "tooltip",
    "addButtonPosition": "top",
    "spacing": [3, 1],
    "table": true
  }
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"addButtonLabel"no"Add to \${label}"StringCustom add Button Label.
"addButtonLabelType"no"tooltip""tooltip" or "inline"Whether the Label should be inline or as tooltip.
"addButtonPosition"no"top""top" or "bottom"Position of the add Button.
"spacing"no1Array of Numberflex-grow for each element.
"table"yesfalse"true" or "falseMust be true, else it's a Grid Array Control.

Horizontal Layout

UI Schema and Custom options

{
  "type": "HorizontalLayout",
  "elements": [ ... ],
  "options": {
    "spacing": [3, 1]
  }
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"spacing"no1Array of Numberflex-grow for each element.

Boolean Checkbox (Toggle) Component

React Spectrum Checkbox

Schema

{
  "type": "object",
  "properties": {
    "radioGroup": {
      "enum": ["Option1", "Option2", "Option3"]
    }
  },
  "required": ["radioGroup"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"enum"yesnullArray of Radio OptionsMust be provided.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/radioGroup",
      "label": "Radio Group Component", //Optional Label, default label is the property name, in this example it would be Radio Group
      "options": {
        "format": "radio",
        "isEmphasized": true,
        "labelAlign": "start",
        "labelPosition": "top",
        "orientation": "horizontal"
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"format"yesnull"radio"Must be Radio.
"isEmphasized"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"orientation"no"vertical""horizontal" or "vertical"How the Radios should be aligned.

Boolean Checkbox (Toggle) Component

React Spectrum Checkbox

Schema

{
  "type": "object",
  "properties": {
    "checkbox": {
      "type": "boolean"
    }
  },
  "required": ["checkbox"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"type"yesnull"boolean"Must be Boolean.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/checkbox",
      "label": "Checkbox Component", //Optional Label, default label is the property name, in this example it would be Checkbox
      "options": {
        "focus": true,
        "isEmphasized": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"isEmphasized"nofalsetrue or falseChanges the appearance.

Date Component (React Spectrum Alpha)

React Spectrum DatePicker (ALPHA)

How to use it

Schema

{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date"
    }
  },
  "required": ["date"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"format"yesnull"date-time"Must be Date, else it's a string.
"type"yesnull"string"Must be String.

UI Schema and Custom options

UI Schema
{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/date",
      "label": "Date Component", //Optional Label, default label is the property name, in this example it would be Date
      "options": {
            "description": "Custom description",
            "erroMessage": "Custom error message",
            "focus": true,
            "hideTimeZone": true,
            "isQuiet": true,
            "labelAlign": "end",
            "labelPosition": "top",
            "locale": "ja-Jpan-JP-u-ca-japanese-hc-h12",
            "maxValue": "2022-12-31",
            "maxVisibleMonths": 3,
            "minValue": "today",
            "necessityIndicator": "label",
            "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"description"nonullStringA Description for your Date Time Component. Will be displayed if no error is displayed.
"errorMessage"nonullString or false (no ErrorMessage)Create a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"hideTimeZone"notruetrue or falseHides Time Zone or not.
"isQuiet"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"locale"no"gregory"String See MDN for more InformationsWhich Calendar should be used.
"maxValue"nonullDate E.g. "2022-12-31" or "today"When the Value is above maxValue, a warning icon will be displayed inside the Component and you can't pick a Date after maxValue.
"maxVisibleMonths"no1IntegerHow many Months should be displayed while Picking.
"minValue"nonullDate E.g. "2022-12-31" or "today"When the Value is below minValue, a warning icon will be displayed inside the Component and you can't pick a Date befor minValue.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Date Time Component (React Spectrum Alpha)

React Spectrum DatePicker (ALPHA)

How to use it

Schema

{
  "type": "object",
  "properties": {
    "dateTime": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": ["dateTime"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"format"yesnull"date-time"Must be Date-Time, else it's a string.
"type"yesnull"string"Must be String.

UI Schema and Custom options

UI Schema
{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/dateTime",
      "label": "Date Time Component", //Optional Label, default label is the property name, in this example it would be Date Time
      "options": {
            "description": "Custom description",
            "erroMessage": "Custom error message",
            "focus": true,
            "granularity": "hour",
            "hideTimeZone": true,
            "hourCycle": "24",
            "isQuiet": true,
            "labelAlign": "end",
            "labelPosition": "top",
            "locale": "ja-Jpan-JP-u-ca-japanese-hc-h12",
            "maxValue": "2022-12-31",
            "maxVisibleMonths": 3,
            "minValue": "today",
            "necessityIndicator": "label",
            "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"description"nonullStringA Description for your Date Time Component. Will be displayed if no error is displayed.
"errorMessage"nonullString or false (no ErrorMessage)Create a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"granularity"no"minute""minute" or "hour"Decide if you want only hours or hours and minutes.
"hideTimeZone"notruetrue or falseHides Time Zone or not.
"hourCycle"noUses the Browser hour cycle"12" or "24"Decide if the User should use 12 or 24 hour format.
"isQuiet"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"locale"no"gregory"String See MDN for more InformationsWhich Calendar should be used.
"maxValue"nonullDate(Time), E.g. ("2022-12-31T23:59:59" or "2022-12-31") or "today"When the Value is above maxValue, a warning icon will be displayed inside the Component and you can't pick a Date after maxValue.
"maxVisibleMonths"no1IntegerHow many Months should be displayed while Picking.
"minValue"nonullDate(Time), E.g. ("2022-12-31T00:00:00" or "2022-12-31") or "today"When the Value is below minValue, a warning icon will be displayed inside the Component and you can't pick a Date befor minValue.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Enum Autocomplete Component

React Spectrum Picker

Schema

{
  "type": "object",
  "properties": {
    "enum": {
      "type": "string",
      "enum": ["foo", "bar"]
    }
  },
  "required": ["enum"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"enum"yesnull"enum"Must be enum.
"type"nonull"string"Optional.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/enum",
      "label": "Enum Component", //Optional Label, default label is the property name, in this example it would be Enum
      "options": {
        "align": "start",
        "autocomplete": false,
        "defaultOpen": true,
        "description": "ComboBox description",
        "direction": "top",
        "errorMessage": "Custom error message",
        "focus": true,
        "isQuiet": true,
        "labelAlign": "end",
        "labelPosition": "side",
        "menuWidth": "size-100",
        "necessityIndicator": "label",
        "placeholder": "Select an option",
        "shouldFlip": true,
        "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"align"no"start""start" or "end"Alignment of the menu relative to the input target.
"autocomplete"yestruetrue or falseMust be false for a Picker, else it's a ComboBox.
"defaultOpen"nofalsetrue or falseWhether the Picker is open after it rendered or not.
"description"nonullStringA Description for your ComboBox. Will be displayed if no error is displayed.
"direction"no"bottom""bottom" or "top"Direction the menu will render relative to the ComboBox.
"errorMessage"nonullString or false (no ErrorMessage)Create a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"isQuiet"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"menuWidth"nonullE.g. "size-100" See all OptionsWidth of the menu.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"placeholder"nonullStringText which is displayed inside the Component if it's empty (Placeholdertext).
"shouldFlip"notruetrue or falseWhether the menu should automatically flip direction when space is limited.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Enum Autocomplete Component

React Spectrum ComboBox

Schema

{
  "type": "object",
  "properties": {
    "enumAutocomplete": {
      "type": "string",
      "enum": ["foo", "bar"]
    }
  },
  "required": ["enumAutocomplete"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"enum"yesnull"enum"Must be enum.
"type"nonull"string"Optional.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/enumAutocomplete",
      "label": "Enum Autocomplete Component", //Optional Label, default label is the property name, in this example it would be Enum Autocomplete
      "options": {
        "allowsCustomValue": true,
        "autocomplete": true,
        "description": "ComboBox description",
        "direction": "top",
        "errorMessage": "Custom error message",
        "focus": true,
        "isQuiet": true,
        "labelAlign": "end",
        "labelPosition": "side",
        "menuTrigger": "manual",
        "necessityIndicator": "label",
        "placeholder": "Select an option",
        "shouldFlip": true,
        "shouldFocusWrap": true,
        "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"allowsCustomValue"nofalsetrue or falseWhether the ComboBox allows a non-item matching input value to be set.
"autocomplete"yestruetrue or falseMust be true for a ComboBox, else it's a Picker.
"description"nonullStringA Description for your ComboBox. Will be displayed if no error is displayed.
"direction"no"bottom""bottom" or "top"Direction the menu will render relative to the ComboBox.
"errorMessage"nonullString or false (no ErrorMessage)Create a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"isQuiet"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"menuTrigger"no"input""input", "focus" or "manual"The interaction required to display the ComboBox menu. It has no effect on the mobile ComboBox.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"placeholder"nonullStringText which is displayed inside the Component if it's empty (Placeholdertext).
"shouldFlip"notruetrue or falseWhether the menu should automatically flip direction when space is limited.
"shouldFocusWrap"nofalsetrue or falseWhether keyboard navigation is circular.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Integer Component

React Spectrum NumberField

Schema

{
  "type": "object",
  "properties": {
    "integer": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    }
  },
  "required": ["integer"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"maximum"nonullInteger (>= minimum)Highest Integer to accept.
"minimum"nonullIntegerLowest Integer to accept.
"type"yesnull"integer"Must be Integer.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/integer",
      "label": "Integer Component", //Optional Label, default label is the property name, in this example it would be Integer
      "options": {
        "decrementAriaLabel": "ARIALABELDOWN",
        "description": "Number Description",
        "errorMessage": "Custom Error",
        "focus": true,
        "formatOptions": {
          "style": "currency",
          "currency": "EUR"
        },
        "hideStepper": true,
        "incrementAriaLabel": "ARIALABELUP",
        "labelAlign": "end",
        "labelPosition": "side",
        "necessityIndicator": "label",
        "step": 2
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"decrementAriaLabel"noDecrement -${step}StringCreate a Custom Aria Label for the Decrement Stepper.
"description"nonullStringA Description for your Integer Field. Will be displayed if no error is displayed.
"errorMessage"noError Message based on min and/or maxString or falseCreate a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"formatOptions"nofalseE.g.{ style: 'percent' } See MDN for Full ListThe Display Format of the Value Label.
"hideStepper"nofalsetrue or falseIf true there is no visible Stepper.
"incrementAriaLabel"noIncrement +${step}StringCreate a Custom Aria Label for the Increment Stepper.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"step"no1positive IntegerHow much the value should increase or decrease for every step.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Number Component

React Spectrum NumberField

Schema

{
  "type": "object",
  "properties": {
    "number": {
      "type": "number",
      "minimum": 1,
      "maximum": 5
    }
  },
  "required": ["number"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"maximum"nonullNumber (>= minimum)Highest Number to accept.
"minimum"nonullNumberLowest Number to accept.
"type"yesnull"number"Must be Number.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/number",
      "label": "Number Component", //Optional Label, default label is the property name, in this example it would be Number
      "options": {
        "decrementAriaLabel": "ARIALABELDOWN",
        "description": "Number Description",
        "errorMessage": "Custom Error",
        "focus": true,
        "formatOptions": {
          "style": "currency",
          "currency": "EUR"
        },
        "hideStepper": true,
        "incrementAriaLabel": "ARIALABELUP",
        "labelAlign": "end",
        "labelPosition": "side",
        "necessityIndicator": "label",
        "step": 2
      }
    }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"decrementAriaLabel"noDecrement -${step}StringCreate a Custom Aria Label for the Decrement Stepper.
"description"nonullStringA Description for your Integer Field. Will be displayed if no error is displayed.
"errorMessage"noError Message based on min and/or maxString or falseCreate a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"formatOptions"nofalseE.g.{ style: 'percent' } See MDN for Full ListThe Display Format of the Value Label.
"hideStepper"nofalsetrue or falseIf true there is no visible Stepper.
"incrementAriaLabel"noIncrement +${step}StringCreate a Custom Aria Label for the Increment Stepper.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"step"no0.1positiveHow much the value should increase or decrease for every step.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Star Rating Component

Custom Component with Workflow Star Icon

Schema

{
  "type": "object",
  "properties": {
    "rating": {
      "type": "integer",
      "maximum": 10,
      "minimum": 1
    }
  },
  "required": ["rating"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"maximum"no5positive Number (>= minimum)How much Stars should rendered.
"minimum"nonullNumber between 0 and maximumLowest Number to accept.
"type"yesnull"integer"Must be Integer.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/rating",
      "label": "Rating Component", //Optional Label, default label is the property name, in this example it would be Rating
      "options": {
        "necessityIndicator": "label",
        "orientation": "vertical",
        "rating": true,
        "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"orientation"no"horizontal""horizontal" or "vertical"How the Stars should be aligned.
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.
"rating"yesWithout "rating" it's a Integer Fieldtrue or falseIf true the Component will be a Star Rating.

Slider Component

React Spectrum Slider

Schema

{
  "type": "object",
  "properties": {
    "range": {
      "type": "number",
      "default": 0,
      "minimum": 0,
      "maximum": 100,
      "multipleOf": 2
    }
  },
  "required": ["range"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"default"yesnullNumber between min and maxDefault Value.
"maximum"yesnullNumber (>= minimum)Highest Number to accept.
"minimum"yesnullNumberLowest Number to accept.
"multipleOf"no1NumberHow big a Step should be.
"type"yesnull"integer" or "number"Depends on the Value you need.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/range",
      "label": "Range Component", //Optional Label, default label is the property name, in this example it would be Range
      "options": {
        "formatOptions": {
          "style": "currency",
          "currency": "EUR"
        },
        "getValueLabel": "of 1",
        "trackGradient": ["#000000", "blue"],
        "fillOffset": 2,
        "isFilled": true,
        "slider": true,
        "trim": false
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"fillOffset"nofalseNumber between minimum and maximumThe offset from which to start the fill.
"formatOptions"nofalseE.g.{ style: 'percent' } See MDN for Full ListThe Display Format of the Value Label.
"getValueLabel"nonullStringCustom Value Label, like "Bananas".
"isFilled"nofalsetrue or falseWhether a fill color is shown between the start of the slider and the current value.
"slider"yesWithout "slider" it's a Number/Integer Fieldtrue or falseIf true the Component will be a toggle instead of a Number Field.
"trackGradient"nonullArray of Color Values, HEX, RGB, RGBA, Color Name and HSL are supportedThe background of the track, specified as the stops for a CSS background: linear-gradient
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.

Boolean Switch (Toggle) Component

React Spectrum Switch

Schema

{
  "type": "object",
  "properties": {
    "switch": {
      "type": "boolean"
    }
  },
  "required": ["switch"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"type"yesnull"boolean"Must be Boolean.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/switch",
      "label": "Switch Component", //Optional Label, default label is the property name, in this example it would be Switch
      "options": {
        "focus": true,
        "isEmphasized": false,
        "toggle": true
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"isEmphasized"nofalsetrue or falseChanges the appearance.
"toggle"yesWithout "toggle" it's a Checkboxtrue or falseIf true the Component will be a toggle.

Text Field Component

React Spectrum TextField

Schema

{
  "type": "object",
  "properties": {
    "textfield": {
      "type": "string"
    }
  },
  "required": ["textfield"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"type"yesnull"string"Must be String.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/textfield",
      "label": "TextField Component", //Optional Label, default label is the property name, in this example it would be Textfield
      "options": {
        "description": "Text Field Description",
        "errorMessage": "Custom Error Message!",
        "focus": true,
        "inputMode": "text",
        "isQuiet": false,
        "labelAlign": "end",
        "labelPosition": "top",
        "maxLength": 5,
        "minLength": 1,
        "necessityIndicator": "label",
        "placeholder": "Enter text",
        "trim": true,
        "type": "text"
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"description"nonullStringA Description for your Text Field. Will be displayed if no error is displayed.
"errorMessage"noError Message based on minLength and/or maxLengthString or false (No ErrorMessage)Create a Custom Error Message.
"focus"nofalsetrue or falseIf true it will be focused after it rendered.
"inputMode"no"none""decimal", "email", "none", "numeric", "search", "tel", "text" or "url"Helper for the User Agent. See MDN.
"isQuiet"nofalsetrue or falseChanges the appearance.
"labelAlign"no"start""start" or "end"Has only effect when labelPosition="top". Place the Label at the start or end of the control.
"labelPosition"no"top""top" or "side"Position of the Label.
"maxLength"noInfinityIntegerWhen the Length is above maxLength, a warning icon will be displayed inside the Component + Error Message.
"minLength"no0IntegerWhen the Length is below minLength, a warning icon will be displayed inside the Component + Error Message.
"necessityIndicator"nofalse"label", "icon" or falseDecide if the necessity indicator should be displayed, icon = *, label = "required" or "optional" in the Browser Language.
"placeholder"nonullStringText which is displayed inside the Component if it's empty (Placeholdertext).
"trim"nofalsetrue or falseIf false the Component uses 100% width, else the Component will be trimmed.
"type"no"text""password", "search", "tel", "email", "text", "url"Define what Type it should be. See MDN.

Text Area Component

React Spectrum TextArea

Schema

{
  "type": "object",
  "properties": {
    "textarea": {
      "type": "string"
    }
  },
  "required": ["textarea"] //If it should be required
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"type"yesnull"string"Must be String.

UI Schema and Custom options

{
  "type": "HorizontalLayout", //or any other layout
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/textarea",
      "label": "TextArea Component", //Optional Label, default label is the property name, in this example it would be Textarea
      "options": {
        "description": "Text Area Description",
        "errorMessage": "Custom Error Message!",
        "focus": true,
        "inputMode": "text",
        "isQuiet": false,
        "labelAlign": "end",
        "labelPosition": "top",
        "maxLength": 5,
        "minLength": 1,
        "multi": true,
        "necessityIndicator": "label",
        "placeholder": "Enter text",
        "trim": true,
        "type": "text"
      }
    }
  ]
}

Custom Options Overview

OptionRequiredDefault (Option not used)ValuesDescription
"description"nonullStringA Description for your Text Area. Will be displayed if no error is displayed.
"errorMessage"noError Message based on minLength and/or maxLengthString or false (no ErrorMessage)