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

# 切换

<Tabs>
  <Tab title="用法">
    ```jsx theme={null}
    import { Toggle } from "twenty-ui/input";

    export const MyComponent = () => {
      return (
        <Toggle
        value = {true}
        onChange = {()=>console.log('On Change event')}
        color="green"
        toggleSize = "medium"
        />
      );
    };
    ```
  </Tab>

  <Tab title="属性">
    | 属性         | 类型       | 描述                                      | 默认     |
    | ---------- | -------- | --------------------------------------- | ------ |
    | 值          | 布尔值      | 切换的当前状态                                 | `假`    |
    | onChange   | function | 当切换状态变化时触发的回调函数                         |        |
    | 颜色         | string   | 开关时的颜色                                  | 蓝色颜色   |
    | toggleSize | string   | 切换的尺寸，影响高度和宽度。 有两个选项：`small` 和 `medium` | medium |
  </Tab>
</Tabs>
