> ## Documentation Index
> Fetch the complete documentation index at: https://docs.explo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch

> Switches allow your customers to be able to move between two configured states of your dashboard.

<img src="https://mintcdn.com/explo/CaJC4DeBEWf_KlnL/images/creating-dashboards/switch-1.png?fit=max&auto=format&n=CaJC4DeBEWf_KlnL&q=85&s=2c6db75c9b876a6225d7d6130a927ed9" alt="" width="188" height="220" data-path="images/creating-dashboards/switch-1.png" />

## What it does

This component allows you to configure your dashboard so your customer can shift
between two different states.

## Configuration

<img src="https://mintcdn.com/explo/CaJC4DeBEWf_KlnL/images/creating-dashboards/switch-2.png?fit=max&auto=format&n=CaJC4DeBEWf_KlnL&q=85&s=48e928ab4a4a884d9def924bef8f7c08" alt="" width="432" height="250" data-path="images/creating-dashboards/switch-2.png" />

<img src="https://mintcdn.com/explo/CaJC4DeBEWf_KlnL/images/creating-dashboards/switch-3.png?fit=max&auto=format&n=CaJC4DeBEWf_KlnL&q=85&s=376c7ea86767e7625bf53a3199496193" alt="" width="432" height="447" data-path="images/creating-dashboards/switch-3.png" />

### Basic Configuration

| Configuration Option        | Description                                                                                                                                                                                                           |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Label                       | The is the label that appears on the left side of the switch. It defaults to "Switch". The toggle allows you to choose whether or not to display this label.                                                          |
| Descriptive Tooltip         | This can be configured to display a helpful popover to the customer. The toggle allows you to choose whether or not to display the tooltip.                                                                           |
| On/Off Label                | This is the label that appears on the right side of the switch, and it denotes the status of the switch. The toggle allows you to choose whether or not to display this label.                                        |
| On/Off Value                | This allows you to configure the value of the corresponding variable for this element. The default values are `true` for On and `false` for Off.                                                                      |
| Set Default Value           | Specify if default should be on or off                                                                                                                                                                                |
| Enable Dependency Selection | When enabled, you may create a dependency between this element and other elements on the dashboard. When this element is dependent on an element selected, it will be disabled until a value is selected by the user. |

## Variable Usage

In the SQL query, use the following syntax

```sql theme={null}
--- basic usage:
WHERE 1=1
[[AND column_1 = {{switch1}}]]

--- filter a chart based on a column if switch is on, do nothing if switch is off
WHERE [[(({{switch1}} = 'true' AND column_1 = true) OR ({{switch1}} = 'false'))]]
```

## Filtering

You can now filter directly your charts in the UI elements themselves. For more information on this process, see the [filtering section of the overview page](/creating-dashboards/ui-elements#filtering).
