# Boolean Configs

## Common booleans

### Switch

The switch is the best way to represent a simple boolean. It's got both a single and dual column variant, and the option you'll use the most.

```java
@Switch(
    name = "Toggle Switch (1x)",
    size = OptionSize.SINGLE // optional
)
public static boolean bob = false;        // default value
```

This code will create a switch like this:

![Toggle Switch example (off and on states)](https://3056662043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPLa0wt84LweTZoNVj4Z%2Fuploads%2FKGH7K79b3aKA1Bi0EELg%2Fimage.png?alt=media\&token=8fd6731d-70a5-4f4f-8c18-869c70839792)

### Checkbox

A checkbox is the best way to represent less important booleans. It's got both single and dual-column variants.

```java
@Checkbox(
    name = "Im a checkbox!",
    size = OptionSize.DUAL // optional
)
public static boolean something = false;        // default value
```

![Checkbox examples (off and on states)](https://3056662043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPLa0wt84LweTZoNVj4Z%2Fuploads%2FCoEl06bzff0MiL3TPTJx%2Fimage.png?alt=media\&token=ac8198d1-70da-416e-a54c-00c1cad1cd94)

### When should you use a switch or checkbox

The switch option is intended for strict ON/OFF options, such as particles. You either see particles, or you don't. In contrast, checkboxes are intended for finer, more detailed control. Maybe you enable potion particles and disable crits.&#x20;

## Dual Option

Out of the three simple config components, dual options are the most unusual. It's got both single and dual-column variants.

{% hint style="info" %}
**Designers note:** These exist for when a simple ON/OFF component wouldn't make sense. Such as a direction, or time of day. Essentially, a boolean that wouldn't make sense with yes/no.
{% endhint %}

```java
@DualOption(
    name = "I can slide!", // name of the element
    left = "I'm Left",     // string to display on the left
    right = "No, right!"   // string to display on the right
)
public static boolean leftyrighty = false;        // default value
```

![](https://3056662043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPLa0wt84LweTZoNVj4Z%2Fuploads%2FHEFqgJJU59ch51LuTtnH%2Fimage.png?alt=media\&token=e0066baa-f1a4-448d-a674-14e41c45a358)
