How to Manage Checkbox field in ui component form Magento 2?

You can Manage/add the checkbox component field in admin panel Ui Component form Magento. You can add Checkbox type field with toggle, radio and regular checkbox option.

Use formElement as checkbox in XML file with field tag. <field name=”my_field” sortOrder=”10″ formElement=”checkbox”>

Add below XML code snippet for the checkbox component in custom form xml file to show toggle,

<?xml version="1.0" encoding="UTF-8"?>
 * Rakesh Jesadiya
 * Category Page add checkbox field...
<form xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general" sortOrder="5">
        <field name="is_active" sortOrder="10" formElement="checkbox">
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                <label translate="true">Enable Page</label>
                            <map name="false" xsi:type="string">0</map>
                            <map name="true" xsi:type="string">1</map>

If you want to show checkbox as toggle, use node,

You can display checkbox as radio option using,
<prefer>radio</prefer> in <formElements><settings /> node.

If you want to display a regular checkbox field, you don’t need to write <prefer> node in <formElements><settings />.
The default value is the regular checkbox icon for the checkbox field.