Switch ====== .. granite:servercomponent:: /libs/granite/ui/components/coral/foundation/form/switch :supertype: /libs/granite/ui/components/coral/foundation/form/field A switch component to represent boolean concept (the "On"/"Off" toggle switch). It extends :granite:servercomponent:`Field ` component. It has the following content structure: .. gnd:gnd:: [granite:FormSwitch] > granite:FormField /** * The name that identifies the field when submitting the form. */ - name (String) /** * ``true`` to generate the `SlingPostServlet @Delete `_ hidden input based on the name. */ - deleteHint (Boolean) = true /** * The value of the field. */ - value (String) = 'true' /** * The submit value of the field when it is unchecked. */ - uncheckedValue (String) = 'false' /** * Indicates if the field is in disabled state. */ - disabled (Boolean) /** * Indicates if the field is mandatory to be filled. */ - required (Boolean) /** * The name of the validator to be applied. E.g. ``foundation.jcr.name``. * See :doc:`validation ` in Granite UI. */ - validation (String) multiple /** * ``true`` to pre-check this field, ``false`` otherwise. */ - checked (Boolean) /** * If ``false``, the checked status is based on matching the form values by ``name`` and ``value`` properties. * Otherwise, the form values are not matched, and the checked status is based on ``checked`` property specified. */ - ignoreData (Boolean) /** * The class for the wrapper element. */ - wrapperClass (String)