> For the complete documentation index, see [llms.txt](https://legacy-docs.aragon.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.aragon.org/developers/tools/aragonui/data-entry/switch.md).

# Switch

A simple switch component.

## Usage <a href="#usage" id="usage"></a>

```jsx
import React, { useState } from 'react'
import { Switch } from '@aragon/ui'

const App = () => {
  const [checked, setChecked] = useState(false)
  return <Switch checked={checked} onChange={setChecked} />
}
```

## Demonstration

![](/files/DUZrSGs20wEBGA8PLyLL)

## Props <a href="#props" id="props"></a>

#### `checked` <a href="#checked" id="checked"></a>

| TYPE      | DEFAULT VALUE |
| --------- | ------------- |
| `Boolean` | `false`       |

#### `disabled` <a href="#disabled" id="disabled"></a>

| TYPE      | DEFAULT VALUE |
| --------- | ------------- |
| `Boolean` | `false`       |

#### `onChange` <a href="#onchange" id="onchange"></a>

| TYPE                                  | DEFAULT VALUE |
| ------------------------------------- | ------------- |
| `Function`: `(checked: Boolean) -> *` | `() => {}`    |
