Switch

Switch field is a input wrapper form field that can be used with in FormSchema.


Usage

import { ItsyForm } from '@itsy-ui/form';

const formSchema = {
  "id": "sample-form",
  "displayName": "Sample form",
  "typeId": "form",
  "propertyDefinitions": {
    "switch": {
      "id": "switch",
      "displayName": "Switch",
      "propertyType": "string",
      "updatability": "readwrite",
      "ui:widget": "switch",
      "required": true
    }
  }
}

const schema = {
  typeId: "sample_form",
  formSchema: formSchema
};

<ItsyForm className="form" schema={schema} />


API

name type default description
className String '' additional class name of root node.
displayName String Field display name that renders in the form.
required Boolean Specifies if the form field is required or not.



Compatibility

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
Edge last 2 versions last 2 versions last 2 versions last 2 versions