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

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

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

Add below XML code snippet for the checkbox component in a custom form XML file to show the 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 the checkbox as a toggle, use node,

You can display the checkbox as a 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.