# CMS: Adding and Setting Up the Switch Input Element

Source: https://support.wix.com/en/article/cms-adding-and-setting-up-a-switch-element (updated 2026-11-11)
Related: Wix developer documentation, https://dev.wix.com/docs/llms.txt; Help Center index, https://support.wix.com/en/llms.txt

Allow visitors to toggle a switch and submit a binary response to a Boolean (true or false) collection field. For example, you could use the Switch input element to allow visitors to opt-in to a newsletter from a [custom form made up of other input elements](https://support.wix.com/en/article/cms-creating-a-custom-form-with-input-elements-that-submit-to-your-collection).

> **Note:** Input elements aren't available in the Wix Harmony Editor, so visitors can't filter your content or submit items to your collection. To collect information from visitors, add a form with Wix Forms instead. Learn more about [features that work differently in Wix Harmony](https://support.wix.com/en/article/wix-harmony-whats-new-with-the-cms#features-that-work-differently-in-wix-harmony).

**Wix Editor:**

1. [Go to your editor](https://manage.wix.com/account/site-selector/?actionUrl=https%3A%2F%2Fwww.wix.com%2Feditor%2F%7BmetaSiteId%7D%3FeditorSessionId%3D%7Besi%7D%26).
2. Add the Switch input element:  
   1. Go to the page where you want visitors to use the Switch input to submit a response.  
   2. Click **Add Elements** ![](https://d2x3xhvgiqkx42.cloudfront.net/65d5031a-8d20-483c-b08f-0a758e1cf2fd/68a0236f-77f4-43c6-931f-8298ae691a9e/2022/11/17/01f24c8b-2ea3-4d06-a26d-9975a43d617e/a79e245b-4870-4444-ba82-248eca4eb9a7.png) on the left side of the editor.  
   3. Click **Input**.  
   4. Click **Switch**.  
   5. Click and drag the relevant Switch input element onto the page.

![Screenshot of adding the Switch input element in the Wix Editor.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/55b3b492-24d4-4b46-9663-5c5e9182175c/d4cc38d8-596b-404d-8c11-e89e9e31bba8.png)

1. Connect the Switch element to the CMS collection where you will store the submissions:  
   1. Click the **Connect to CMS** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/06/16/2d484f5d-e1bf-4d48-9e42-82216e8b88de/08e74518-edad-42f8-b007-c974ba767eb6.png) on the Switch element.  
   2. Click the **Choose a dataset** drop-down and select a dataset that connects to the collection where you will store the submissions.  
   3. Click the **Toggled state connects to** drop-down and choose the boolean field in which you will store the submissions.  
   **Tip:** To add a new field for storing submissions, select **+ Add**, then enter the field name and click **Add**.  
   4. Set the dataset mode and collection permissions:  
         1. Click **Dataset Settings** in the panel on the right.  
         2. (Optional) Click the [permission type](https://support.wix.com/en/article/cms-collection-permissions-overview) next to **Permissions** to determine who can view, add, update, or delete collection content.  
         3. Click the **Dataset mode** drop-down and select the relevant option:  
                  * **Write:** Connected [input elements](https://support.wix.com/en/article/cms-about-user-input-elements) can add new items to the collection, but cannot edit existing items.  
                  * **Read & Write:** Connected elements can update existing items in the collection. If you connect a ['New' button](https://support.wix.com/en/article/cms-about-dataset-click-actions-for-buttons-and-images#new), visitors can use it to update existing items and add new items to your collection.  
         4. Click **Back to Switch element** at the top of the **Dataset Settings** panel.

![Screenshot of setting the collection permissions and dataset mode in the Wix Editor.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/6ab840c5-474d-407e-8a1a-e0c25b4ceb55/02c799cd-e7fd-4648-8efe-726c1dfd4807.png)

1. Customize the Switch input element:  
   * Click **Settings** to edit the following:  
         * **Field title:** Edit the title text that lets visitors know what the switch does.  
         * **Value:** (Velo only) Enter the component's value property used in your JavaScript code.  
         * **Field type:** Select the checkbox if you want the switch to be toggled on by default.  
   * Click the **Layout** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/04/24/1e3a7616-1ca3-40ad-9e94-d2e18bfd4b98/33c4ffdc-7138-462f-b6e2-4d6505f6f8f6.png) to edit the following:  
         * **Field title format:** Choose how the field title displays if there is not enough space: **Wrap** or **Show overflow**  
         * **Handle placement:** Choose whether the handle appears inside or outside of the slider track.  
         * **Handle / track size (% of the Track / handle):** Drag the slider to change the handle or track size.  
         * **Switch height:** Set the height of the switch component.  
         * **Space between switch and title:** Edit the spacing between the title and the switch.  
         * **Field title indent:** Drag the slider to edit the indentation of the field title.  
         * **Display handle icons:** Click the toggle to enable or disable the handle icons.  
         * **Formatting:** Set the text direction and alignment.  
   * Click the **Design** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/04/24/d44e4657-75f7-476b-a92f-c0ed3bc775bc/4d1470bd-bd1d-4d8b-ac9d-5015333e2742.png) to customize the design for both states: **Switch On** and **Switch Off**

![Screenshot of adjusting the Switch element's settings.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/d2a5233b-72b5-405c-969f-1d0aeecd2a68/de21ae58-cfa6-42ec-b9fa-60a987240336.png)

1. [Add a 'Submit' button](https://support.wix.com/en/article/cms-creating-a-custom-form-with-input-elements-that-submit-to-your-collection#step-5-create-a-submit-button) for visitors to click to send their submissions.

![Screenshot of adding a Submit button.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/c48ae814-bc2a-47e5-9ae4-96b9428eb735/3c74cc8e-e338-4d68-a4d0-8c313c785a54.png)

1. Click **Preview** to test your connections.
2. Click **Publish** if you are ready to make the changes go live.

**Studio Editor:**

1. [Go to your editor](https://manage.wix.com/account/site-selector/?actionUrl=https%3A%2F%2Fwww.wix.com%2Feditor%2F%7BmetaSiteId%7D%3FeditorSessionId%3D%7Besi%7D%26).
2. Add the Switch input element:  
   1. Go to the page where you want visitors to use the Switch input to submit a response.  
   2. Click **Add Elements** ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/8696077d-830a-4b1e-bd86-9df98f89994a/2023/06/14/cef22a14-dfc9-43c7-a54f-72ed83266050/741248d2-4240-497e-a282-2a7d15d8afac.png) on the left side of the editor.  
   3. Click **Input**.  
   4. Click **Switch**.  
   5. Click and drag the relevant Switch input element onto the page.

![Screenshot of adding the Switch input element in the Studio Editor.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/0cf1fa4f-3e5f-44b5-9d11-2d4a6befb67d/b3c37bbf-c098-444b-b8ad-b3da9199b46d.png)

1. Connect the Switch element to the CMS collection where you will store the submissions:  
   1. Click the **Connect to CMS** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/06/16/2d484f5d-e1bf-4d48-9e42-82216e8b88de/08e74518-edad-42f8-b007-c974ba767eb6.png) on the Switch element.  
   2. Click the **Choose a dataset** drop-down and select a dataset that connects to the collection where you will store the submissions.  
   3. Click the **Toggled state connects to** drop-down and choose the boolean field in which you will store the submissions.  
   **Tip:** To add a new field for storing submissions, select **+ Add**, then enter the field name and click **Add**.  
   4. Set the dataset mode and collection permissions:  
         1. Click **Dataset Settings** in the panel on the right.  
         2. (Optional) Click the [permission type](https://support.wix.com/en/article/cms-collection-permissions-overview) next to **Permissions** to determine who can view, add, update, or delete collection content.  
         3. Click the **Dataset mode** drop-down and select the relevant option:  
                  * **Write:** Connected [input elements](https://support.wix.com/en/article/cms-about-user-input-elements) can add new items to the collection, but cannot edit existing items.  
                  * **Read & Write:** Connected elements can update existing items in the collection. If you connect a ['New' button](https://support.wix.com/en/article/cms-about-dataset-click-actions-for-buttons-and-images#new), visitors can use it to update existing items and add new items to your collection.  
         4. Click **Back to Switch element** at the top of the **Dataset Settings** panel.

![Screenshot of setting the collection permissions and dataset mode in the Studio Editor.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/e5f56097-f322-4cdb-a3c9-a09b39f6c84d/dfeef4a5-1059-4461-9c37-a79a11dff035.png)

1. Customize the Switch input element:  
   * Click **Settings** to edit the following:  
         * **Field title:** Edit the title text that lets visitors know what the switch does.  
         * **Value:** (Velo only) Enter the component's value property used in your JavaScript code.  
         * **Field type:** Select the checkbox if you want the switch to be toggled on by default.  
   * Click the **Layout** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/04/24/1e3a7616-1ca3-40ad-9e94-d2e18bfd4b98/33c4ffdc-7138-462f-b6e2-4d6505f6f8f6.png) to edit the following:  
         * **Field title format:** Choose how the field title displays if there is not enough space: **Wrap** or **Show overflow**  
         * **Handle placement:** Choose whether the handle appears inside or outside of the slider track.  
         * **Handle / track size (% of the Track / handle):** Drag the slider to change the handle or track size.  
         * **Switch height:** Set the height of the switch component.  
         * **Space between switch and title:** Edit the spacing between the title and the switch.  
         * **Field title indent:** Drag the slider to edit the indentation of the field title.  
         * **Display handle icons:** Click the toggle to enable or disable the handle icons.  
         * **Formatting:** Set the text direction and alignment.  
   * Click the **Design** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/04/24/d44e4657-75f7-476b-a92f-c0ed3bc775bc/4d1470bd-bd1d-4d8b-ac9d-5015333e2742.png) to customize the design for both states: **Switch On** and **Switch Off**

![Screenshot of customizing the Switch input element.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/eb421f17-70ad-4c19-aaed-a796f001d421/bbd8e26c-9282-4435-a43f-13f4d4743fd5.png)

1. [Add a 'Submit' button](https://support.wix.com/en/article/cms-creating-a-custom-form-with-input-elements-that-submit-to-your-collection#step-5-create-a-submit-button) for visitors to click to send their submissions.

![Screenshot of a submit button.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2024/08/07/50ea78b9-0e90-49ce-8656-370d93888686/60907cd3-ab9a-49ec-b95f-2141efc1423d.png)

1. Click **Preview** to test your connections.
2. Click **Publish** if you are ready to make the changes go live.
