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

# CheckboxField 多选

> CheckboxField 多选组件参考，介绍选项数据源、默认值与状态切换用法，支持在一组选项中进行多项勾选。

## 何时使用

* 在一组可选项中进行多项选择时。
* 单独使用可以表示两种状态之间的切换，和 switch 类似。区别在于切换 switch 会直接触发状态改变，而 checkbox 一般用于状态标记，需要和提交操作配合。

## 组件示例

<iframe src="https://www.aliwork.com/developer/check-v2?isRenderNav=false" width="100%" height="480" frameBorder="0" />

## 组件属性

| 属性                  | 说明                                                              | 类型                                                                  | 默认值                                                                                                     |
| ------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `behavior`          | 表单组件显示状态                                                        | [Behavior](/zh/open/yida/components/interface#behavior)             | `'NORMAL'`                                                                                              |
| `dataSource`        | 设置选项                                                            | [DataSource\[\]](/zh/open/yida/components/interface#datasource)     | `[ { "text": "选项一", "value": "1" }, { "text": "选项二", "value": "2" }, { "text": "选项三", "value": "3" } ]` |
| `iconPosition`      | 手机端Icon位置                                                       | `'left' \| 'right'`                                                 | `'left'`                                                                                                |
| `itemDirection`     | PC端选项排列方式                                                       | `'hoz' \| 'ver'`                                                    | `'hoz'`                                                                                                 |
| `label`             | 表单组件标题                                                          | `string`                                                            | -                                                                                                       |
| `labelAlign`        | 表单组件标题的位置                                                       | `'left' \| 'top'`                                                   | `'top'`                                                                                                 |
| `labelColOffset`    | 设置标题的偏移位置，配置值为栅格值，1代表1/24                                       | `number`                                                            | `0`                                                                                                     |
| `labelColSpan`      | 设置标题的占位宽度，配置值为栅格值，1代表1/24                                       | `number`                                                            | `4`                                                                                                     |
| `labelTextAlign`    | 表单组件的标题对齐方式                                                     | `'left' \| 'right'`                                                 | `'right'`                                                                                               |
| `labelTipsIcon`     | 表单组件标题提示信息入口图标，当labelTipsTypes取值为 **text** 或 **render** 时生效     | `string`                                                            | -                                                                                                       |
| `labelTipsRender`   | 表单组件标题提示信息自定义渲染方法，当labelTipsTypes取值为 **render** 时生效             | `(props: IComponentProps) => ReactNode`                             | -                                                                                                       |
| `labelTipsText`     | 表单组件标题提示文本信息，当labelTipsTypes取值为 **text** 时生效                    | `string`                                                            | -                                                                                                       |
| `labelTipsTypes`    | 表单组件标题提示信息类型设置                                                  | [LabelTipsTypes](/zh/open/yida/components/interface#labelTipsTypes) | `'none'`                                                                                                |
| `onChange`          | 组件值发生改变事件                                                       | `(value: string[]) => void`                                         | -                                                                                                       |
| `size`              | 表单组件尺寸                                                          | [Size](/zh/open/yida/components/interface#size)                     | `'medium'`                                                                                              |
| `tips`              | 表单组件描述信息，展示在控件下方                                                | `string`                                                            | -                                                                                                       |
| `useDrawerInMobile` | 手机端排列方式，为true则直接平铺，为false则底部弹层                                  | `boolean`                                                           | `false`                                                                                                 |
| `validation`        | 表单组件校验设置，具体使用详见[表单校验文档](/zh/open/yida/guide/concept/validation) | [Validation\[\]](/zh/open/yida/components/interface#validation)     | `[]`                                                                                                    |
| `value`             | 当前组件默认值                                                         | `string[]`                                                          | -                                                                                                       |
| `wrapperColOffset`  | 设置表单组件的偏移位置，设置值为栅格值，1代表1/24                                     | `number`                                                            | `0`                                                                                                     |
| `wrapperColSpan`    | 设置表单组件的占位宽度，设置值为栅格值，1代表1/24                                     | `number`                                                            | `0`                                                                                                     |
