# Switch

Renders a boolean input.

![MonalisaUI](https://raw.githubusercontent.com/tuantvk/monalisa-ui/master/assets/monalisaui-switch.png)

View full example: [Switch Example](https://github.com/tuantvk/monalisa-ui/blob/master/example/Switch/index.js)

```javascript
import React from 'react';
import { View } from 'react-native';
import { Switch } from 'monalisa-ui';

const Example = () => (
  <View>
    <Switch />
  </View>
);

export default Example;
```

## Configuration

| Property    | Default |  Option  |             Description             |
| ----------- | :-----: | :------: | :---------------------------------: |
| style       |    -    |     -    |         Style for the switch        |
| height      |    18   |  number  |            Height switch            |
| bgColor     | #3e50fa |  string  |  Custom colors for the switch track |
| thumbColor  |   #fff  |  string  | Color of the foreground switch grip |
| circleStyle |    -    |     -    |       Style of the thumbColor       |
| onChange    |    -    | function |         Return value switch         |

## Example

* switch customize

```javascript
import React from 'react';
import { View } from 'react-native';
import { Switch } from 'monalisa-ui';

const Example = () => (
  <View>
    <Switch height={30} />
    <Switch bgColor="#ff0000" thumbColor="#53c641" />
    <Switch onChange={() => alert("Change value")} />
  </View>
);

export default Example;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tuantvk.gitbook.io/monalisaui/switch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
