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

# Switch 01

> Pill-shaped toggle switch with a circular white knob that slides left or right.

<Frame>
  ![Switch 01](https://ffciaqoksnnzuihswbxs.supabase.co/storage/v1/object/public/components/Elements/Switchs/switch-simple.png)
</Frame>

## Overview

Switch 01 is a toggle switch UI component that allows users to turn a setting on or off. It uses a custom boolean state to track its active/inactive status, visually shifting the knob position and changing the background color to reflect the current state. It is designed for both web and mobile interfaces and requires no plugins or custom code.

## How to use

<Steps>
  <Step titleSize="h4" title="Open the Brikl panel">
    Navigate to the **Elements** category in the Brikl panel.
  </Step>

  <Step titleSize="h4" title="Copy the component">
    Find **Switch 01** and click **Copy**.
  </Step>

  <Step titleSize="h4" title="Paste into your editor">
    Paste it into your Bubble canvas with `Cmd + V` (Mac) or `Ctrl + V` (Windows),
    or right-click on the canvas and select **Paste**.
  </Step>
</Steps>

## States

This component includes conditional states that automatically change its appearance.

| State         | Trigger                                                             | Visual effect                                                                                |
| ------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Off (default) | Initial load or when custom state 'active\_' is false               | Background is gray (rgba(216,211,212,1)), knob is aligned to the left                        |
| On (active)   | User clicks the switch when 'active\_' is false, setting it to true | Background changes to dark (rgba(27,23,24,1)), knob shifts to the right (flex-end alignment) |

<Note>
  These states are handled natively by Bubble and require no additional setup.
  They will work automatically once the component is pasted into your editor.
</Note>

## Responsive

This component adapts to mobile screens. Font sizes and layout automatically adjust on screens smaller than Bubble's built-in mobile breakpoint.

## Workflows

This component includes pre-built workflows.

| Trigger                                                       | Action                                                            |
| ------------------------------------------------------------- | ----------------------------------------------------------------- |
| Switch group is clicked when 'active\_' custom state is false | Sets the custom state 'active\_' to true, turning the switch on   |
| Switch group is clicked when 'active\_' custom state is true  | Sets the custom state 'active\_' to false, turning the switch off |

<Note>
  These workflows are included when you use the **Copy with Workflows** option in the Brikl panel.
</Note>

## Requirements

|             |              |
| ----------- | ------------ |
| License     | Free         |
| Plugins     | None         |
| Custom code | Not required |

## Platforms

| Platform | Supported |
| -------- | --------- |
| Web      | ✅         |
| Mobile   | ✅         |

## License

<Note>
  This component is available on the free plan.
</Note>
