Master Addons
  • Widgets
    • Changelogs
      Source Code NEW PRO
      Caldera Forms
      Logo Slider
      Table of Contents
      Gravity Forms
      Transforms PRO
      Restrict Content PRO
      Pricing Table
      Ninja Form
      Mailchimp
      Tooltip
      Popup Trigger NEW PRO
      Which Element NEW
      Creative Button
      Creative Links NEW
      Domain Search HOT PRO
      Dual Heading HOT
      Flipbox
      Animated Gradient BG HOT PRO
      Image Hotspot PRO
      Infobox
      News Ticker PRO
      Particles
      Progress Bar
      Off-Canvas Content NEW PRO
      Reading Progress Bar HOT
      Custom JS
      Blockquote
      Counter Up
      Image Hover Effects
      Reveal NEW PRO
      Rellax PRO
      Positioning
      Image Comparison
      Tabs
      Toggle Content HOT PRO
      Post/Page Duplicator FREE
      Floating Effects PRO
      Mega Menu HOT
      Custom CSS HOT
      Gradient Headline
      Advanced Image
      Nav Menu
      Tooltips
      Comparison Table PRO
      Glassmorphism
      Featured Product PRO
      Image Carouse
      Gallery Slider NEW PRO
      Dynamic Tags NEW
      Countdown Timer
      Current Time
      Patterns
      Wrapper Link
      Timeline
      Team Member
      Contact Form 7
      Advanced Accordion
      Animated Headlines
      Blog
      Business Hours
      Call To Action
      Progress Bars
      Background Slider
      Team Slider
      Dynamic Table
      Grid Line PRO
      WP Forms
      Search
      We Form
      Entrance Animation NEW PRO
      Display Conditions PRO
      Filterable Image Gallery
      WP Forms
      Custom Breakpoints NEW
  • Features
    • Theme Builder

      Design site-wide templates for a consistent look across every page of your website.

      Popup Builder

      Create engaging popups, modals, and announcement bars - to capture leads.

      Widget Builder

      Expand Elementor with advanced custom widgets to build more dynamic layouts.

      Mega Menu Builder

      Create multi-column menus with icons and images for superior navigation.

      Custom Css

      Apply your own CSS for pixel-perfect styling beyond default design options.

      Dynamic Tags

      Insert dynamic content like post titles and custom fields directly into designs.

      Display Conditions

      Control element visibility based on user role, device, time, and other rules.

      Icons Library

      Choose from thousands of built-in icons to enhance visuals and consistency.

      Animation

      Add scroll, hover, entrance, and much more animations to bring designs to life.
  • Template Kits
    • Template Kits

      Professionally designed full-page template Kit. Import and customize in seconds.

      Ready Sections

      Pre-built content sections and rows. Drag, drop, and customize instantly.

      Ready Popups

      Different types of High-converting popup designs. Import and launch quickly.

      Ready Pages

      Complete page layouts for any purpose. Start editing immediately.

      Ready Header

      Multiple modern header designs. Import and adapt to your brand.

      Ready Footer

      Fully designed footers for different websites. Add functionality and style in clicks.
  • Brands
    • WP Adminify

      WP Adminify

      Take control of your WordPress dashboard. Customize the admin experience.
      Admin Bar Editor

      Admin Bar Editor

      Customize the WordPress admin bar for a cleaner, more personalized workspace.
      Loginfy

      Loginfy

      Customize your WordPress login page with branding, styles, and security enhancements.

      Rolemaster Suite

      Manage user roles and permissions with precision for better security and workflow.
      Master Blocks

      Master Blocks

      Expand the Gutenberg editor with advanced custom blocks for more creative layouts.
      WP Spotlight

      WP Spotlight

      Instantly search and access admin features, posts, and settings from anywhere.
  • Themes
  • Help
    • Get Support
    • Documentation
    • Facebook Community
    • Changelogs
  • Blog
Pricing
🇺🇸EN
  • 🇺🇸EN
  • 🇸🇦AR
  • 🇧🇩BN
  • 🇩🇰DA
  • 🇩🇪DE
  • 🇪🇸ES
  • 🇫🇷FR
  • 🇮🇳HI
  • 🇰🇷KO
  • 🇵🇹PT
  • 🇷🇺RU
  • 🇨🇳ZH

Getting Started

  • Can’t see the Master Addon Element inside Elementor Page editor?
  • How To Apply For an Affiliate Account?
  • Active Pro version
  • Installing Plugin

Addons

  • Popup Trigger
  • Off-Canvas Content
  • Logo Slider
  • Progress Bars
  • Image Carousel
  • Featured Product
  • Comparison Table
  • Source Code
  • Advanced Image
  • Gradient Headline
  • Gallery Slider
  • Toggle Content
  • Infobox
  • Timeline
  • Dynamic Table
  • Mailchimp
  • Blockquote
  • Changelogs
  • Countdown Timer
  • Current Time
  • Search
  • Filterable Image Gallery
  • Team Slider
  • Counter Up
  • Restrict Content
  • Table of Contents
  • Image Hotspot
  • Image Comparison
  • News Ticker
  • Image Hover Effects
  • Tabs
  • Pricing Table
  • Navigation Menu
  • Domain Search
  • Flipbox
  • Tooltip
  • Creative Links
  • Business Hours
  • Contact Form 7
  • Creative Button
  • Animated Headlines
  • Advanced Accordion
  • Call to Action
  • Progress Bar
  • Blog
  • Team Member
  • Dual Heading

Extensions

  • Mega Menu
  • Which Element
  • Post Duplicator
  • Grid Line
  • Glassmorphism
  • Tooltip
  • Wrapper Link
  • Floating Effects
  • Dynamic Tags
  • Display Conditions
  • Entrance Animation
  • Custom Breakpoints
  • Animated Gradient Background
  • Reveal
  • Particles
  • Background Slider
  • Transforms
  • Rellax
  • Positioning
  • Custom CSS

Widget Builder

  • Conditions
  • Twig Syntax
  • Settings Panel Introduction
  • Divider
  • Text Shadow
  • Select2
  • Border
  • Heading
  • Tabs
  • Repeater
  • Visual Choice
  • Background
  • Dimensions
  • Box Shadow
  • Slider
  • Icons
  • Gallery
  • Media
  • Popover Toggle
  • URL Field
  • Date Time
  • Typography
  • Font
  • Color Field
  • Choose
  • Select
  • Switcher
  • Hidden
  • Code
  • WYSIWYG
  • Textarea Field
  • Number
  • Text Field

Theme Builder

  • Comment Form
  • 404
  • Search
  • Archive
  • Single
  • Footer
  • Header

Popup Builder

  • How to Open a Popup After Inactivity in Elementor
  • How to Show an Exit Intent Popup in Elementor
  • How to Open a Popup on Scroll to a Specific Element in Elementor
  • How to Open a Popup on Scroll in Elementor
  • How to Open a Popup on Click in Elementor
  • How to open a popup on page load?
  • Popup Settings & Options

Template Kit

  • How to Import Template Kits in Master Addons
  • How to Disable Elementor Default Fonts and Colors
  • Import Elementor Template Kits
View Categories
  • Home
  • Docs
  • Widget Builder
  • Switcher

Switcher

Roy Jemee
Updated on August 6, 2026

5 min read

The Switcher field puts Elementor’s familiar yes/no toggle into a custom widget. One flick in the panel and a badge appears, a layout tightens, or a whole block of markup switches off. Inside the Master Addons Widget Builder, the Switcher is the standard way to make any part of a widget optional.

The Switcher is the most common source field for Conditions: it stores yes when on, so other controls can show or hide based on it. On the front end, the Twig-syntax template engine lets you wrap markup in {% if my_toggle %} so the toggle controls the output too. Both guides cover setup and limitations.

Its value is deliberately simple: a string like yes when the toggle is on, an empty string when it is off. That maps straight onto template conditionals. In practice, almost every Switcher ends up wrapped in an {% if %} block or driving the Conditions of other controls.

What the Switcher field does #

  • Renders Elementor’s on/off toggle in the widget panel, with your own on/off labels.
  • Returns a configurable string (default yes) when on, and an empty string when off.
  • Drives {% if %} blocks in the template, so markup renders only when the toggle is on.
  • Switches CSS classes inline, for example class="card {% if compact_mode %}is-compact{% endif %}".
  • Acts as the usual driver for Conditions on other fields, showing or hiding whole groups of controls.

Building your first widget? Start with the Widget Builder overview, then come back here.

Before you start #

  • WordPress with Elementor installed and active.
  • Master Addons for Elementor installed and active. New to the plugin? See the installation guide.
  • A custom widget open in the Widget Builder editor. Our example is a pricing card widget with a Switcher named show_badge that reveals a “Popular” ribbon on the card.

How to add a Switcher field #

Drag the Switcher field from the fields panel into a section under the Content or Style tab. Its options open on the left as soon as it lands.

Switcher field options explained #

  • Label: the text shown next to the toggle in Elementor, for example “Show Badge”.
  • Name: the unique identifier your templates refer to. Letters, numbers, and underscores only, for example show_badge.
  • Label On / Label Off: the short texts on the toggle itself, “Yes” and “No” by default.
  • Return Value: the string the field holds while on, yes by default. Change it when your template or script expects a specific string.
  • Default: set it to the Return Value to start the toggle on; leave it empty to start off.

Note that Default and Return Value have to match exactly for the toggle to start on. If you change the Return Value to enabled but leave Default at yes, the widget drops in with the toggle off and no error tells you why.

Connect the Switcher with an {% if %} block #

The Switcher is a token field, but you rarely print its token on its own. Off means empty string, and an empty string is falsy in template logic, so the natural pattern is a conditional in the HTML panel:

{% if show_badge %}
<span class="pc-badge">Popular</span>
{% endif %}

Toggle on, the badge renders. Toggle off, the markup disappears entirely, leaving no empty wrapper behind. The same pattern switches classes without extra markup:

<article class="pc-card {% if compact_mode %}is-compact{% endif %}">

The Switcher’s other job is driving Conditions. Any field in the widget can be set to appear only when the Switcher is on, so toggling “Show Badge” can also reveal a Badge Text field and a badge color control in the panel. That keeps the panel short until the option is actually in use.

Watch out: if you compare the value explicitly, compare against the Return Value string, not the label. {% if show_badge == 'yes' %} matches the default Return Value; {% if show_badge == 'Yes' %} never matches, because “Yes” is only the toggle’s display text. Bare truthiness, {% if show_badge %}, sidesteps the issue.

Use the Switcher control in Elementor #

Add your custom widget to a page in Elementor (reload the editor if the page was already open). The Switcher shows as the standard Elementor toggle under your label. Click it and the preview updates immediately; any fields conditioned on it appear or disappear in the panel at the same time.

Common use cases #

  • Optional badges and ribbons on cards, wrapped in an {% if %} block.
  • Layout variants like a compact mode, applied as a modifier class.
  • Show/hide sections such as a footer note, an icon, or a secondary button.
  • Feature switches for scripts, where the JS panel reads the value to enable autoplay or animation.
  • Panel gatekeeping, revealing a group of related controls only when their feature is on.

Tips for working with the Switcher field #

  • Test truthiness, not labels. {% if show_badge %} is all most templates need; the on state is a non-empty string and the off state is empty.
  • Wrap the whole optional block. Put the {% if %} around the complete markup, wrapper included, so an off toggle leaves no empty elements to break spacing.
  • Default deliberately. Start the toggle on (Default = Return Value) for features most sites want, off for extras.
  • Pair it with Conditions. A Switcher plus two or three conditioned fields reads far better in the panel than five always-visible controls.
  • Name it as a question the toggle answers. show_badge and compact_mode read naturally inside {% if %} blocks.

Frequently Asked Questions #

What is the Switcher field in the Master Addons Widget Builder?

The Switcher field adds Elementor’s on/off toggle to a custom widget. When on, it holds its Return Value string (yes by default); when off, it holds an empty string. Templates typically wrap optional markup in {% if field_name %} ... {% endif %} to react to it.

What value does the Switcher actually store?

A string. On means the Return Value you configured, off means an empty string. There is no true/false boolean, which is why explicit comparisons must match the Return Value exactly.

How do I show markup only when the toggle is on?

Wrap it in a conditional in the HTML panel: {% if show_badge %}<span class="badge">Popular</span>{% endif %}. The block renders nothing at all while the toggle is off.

Can a Switcher show or hide other fields in the panel?

Yes, and it is the most common driver for that. Set the Conditions on any other field to require the Switcher’s value, and those controls appear in Elementor only while the toggle is on.

Why does my {% if show_badge == ‘Yes’ %} check never pass?

Because “Yes” is the toggle’s Label On text, not its value. The stored value is the Return Value, yes in lowercase by default. Compare against that, or simply use {% if show_badge %}.

Can I change what the field returns when on?

Yes, through the Return Value option. This is useful when the JS panel expects a specific flag string, or when you print the value directly into a data attribute.

Wrapping up #

The Widget Builder Switcher field is the smallest control with the widest reach: one toggle can add markup, swap classes, and reshape the panel through Conditions all at once. Combine it with a Number field for tunable features or a Repeater field whose optional extras it reveals. Explore the rest of the Master Addons widgets and extensions, and see the pricing page for what each plan includes.

What are your Feelings

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on August 6, 2026
SelectHidden
Table of Contents
  • What the Switcher field does
  • Before you start
  • How to add a Switcher field
  • Switcher field options explained
  • Connect the Switcher with an {% if %} block
  • Use the Switcher control in Elementor
  • Common use cases
  • Tips for working with the Switcher field
  • Frequently Asked Questions
    • What is the Switcher field in the Master Addons Widget Builder?
    • What value does the Switcher actually store?
    • How do I show markup only when the toggle is on?
    • Can a Switcher show or hide other fields in the panel?
    • Why does my {% if show_badge == 'Yes' %} check never pass?
    • Can I change what the field returns when on?
  • Wrapping up

Join 30,000+ Web Creators Who Trust Master Addons

Get all the premium widgets and templates you desire, built with clean code that keeps your site fast. Ditch the bloat, not the features.

Try Live Demo
Join The Community
Master Addons for Elementor

80+ Premium Widgets & Lifetime Updates – Build Beyond Limits. An Exclusive Creation by Pixar Labs

Facebook-f Twitter Youtube Wordpress
Features
  • Template kits
  • Template Library
  • Widget Builder
  • Theme Builder
  • Mega Menu Builder
Support
  • Support Forum
  • Contact US
  • Join Community
  • Blog
  • Video Reviews
Resources
  • My Account
  • Changlogs
  • Documentation
  • Video Tutorials
  • Toolz.dev
Navigate
  • Apply for Affiliate
  • Terms of Use
  • Refund Policy
  • Privacy Policy
  • About Us