> For the complete documentation index, see [llms.txt](https://docs.sentre.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentre.io/design-pricinples/switch.md).

# Switch

### Usage

* If you need to represent the switching between two states or on-off state.
* The difference between Switch and Checkbox is that Switch will trigger a state change directly when you toggle it, while Checkbox is generally used for state marking, which should work in conjunction with submit operation.

### States

![](/files/EvcvIiL02o9zcK1oyWYi)

### Specs

![](/files/izCQbNqxoqHiYzqfFk3w)

### Sample code

```
// Some code
```
