---
title: "multiple-choice-checklist"
description: "Select multiple options from a checklist."
permalink: /docs/runtime/all-ui-components/multiple-choice-checklist/
---
# multiple-choice-checklist

<RuntimeVersion updatedSince="4.75.0">
Refreshed the component's appearance and added the `disabled` attribute.
</RuntimeVersion>

## Overview

`multiple-choice-checklist` allows users to select multiple options from a list.

### Basic Example

**main.view\.xml**

```xml
<var name="contact_methods" type="multiple-choice">
    <option key="email">Email</option>
    <option key="sms">SMS</option>
    <option key="Post">Post</option>
</var>

<multiple-choice-checklist label="Preferred Contact Method" bind="contact_methods" />
```

![](./media/spaces-2f9tchlr67elhbojpvhhud-2fuploads-2fgit-blob-313ce5e2bf030c3fb87eb5149a5212b927482a73-2fmultiple-choice-checklist-example-c8aa314a.png)

<a id="advanced-attributes" />
<a id="common-attributes" />

## Data and events

### `bind`

Bind to a `multiple-choice` or `multiple-choice-integer` field or variable.

<AttributeReference label="bind" href="/docs/runtime/common-component-attributes/bind/" />

### `label`

<AttributeReference label="label" href="/docs/runtime/common-component-attributes/label/" />

### `required`

Defaults to `false`. Set to `true` and use a validating button or action (`validate="true"`) to require a value before its handler runs.

<AttributeReference label="required" href="/docs/runtime/common-component-attributes/required/" />

### `on-change`

<Info>

When using `multiple-choice-integer` you can omit the key attribute on options. The array passed to the function assigned to `on-change` will correspond to the key starting from `0.` E.g. `[0, 2]` corresponds to first and third options.

</Info>

<AttributeReference label="on-change" href="/docs/runtime/common-component-attributes/on-change/" badge="advanced" tone="muted" />

### `disabled`

<AttributeReference label="disabled" href="/docs/runtime/common-component-attributes/disabled/" badge="advanced" tone="muted" />

## Input behavior

### `modifier-text`

<AttributeReference label="modifier-text" href="/docs/runtime/common-component-attributes/modifier-text/" badge="advanced" tone="muted" />

## Appearance and visibility

### `checkbox-position`

<SyntaxCard type={["left", "right"]} defaultValue="left" introduced="4.86.1" />

Specify where the checkbox is positioned in the component (relative to the option label).

**main.view\.xml**

```xml
<columns>
    <column>
        <info>checkbox-position="left"</info>
        <multiple-choice-checklist checkbox-position="left" bind="favorite_color" label="Favorite color" />
    </column>
    <column>
        <info>checkbox-position="right"</info>
        <multiple-choice-checklist checkbox-position="right" bind="favorite_color" label="Favorite color" />
    </column>
</columns>
```

![](./media/spaces-2f9tchlr67elhbojpvhhud-2fuploads-2fnfgrrml6bugjane7xqmv-2fimage-e1215049.png)

### `mode`

<SyntaxCard type={["row", "column"]} defaultValue="column" introduced="4.83.0" />

Configure the layout of the list of check box options. `row` lists options horizontally; `column` lists options vertically.

### `align-content`

<AttributeReference label="align-content" href="/docs/runtime/common-component-attributes/align-content/" badge="advanced" tone="muted" />

### `align-label`

<AttributeReference label="align-label" href="/docs/runtime/common-component-attributes/align-label/" badge="advanced" tone="muted" />

### `id`

<AttributeReference label="id" href="/docs/runtime/common-component-attributes/id/" badge="advanced" tone="muted" />

### `label-case`

<AttributeReference label="label-case" href="/docs/runtime/common-component-attributes/label-case/" badge="advanced" tone="muted" />

### `label-color`

<AttributeReference label="label-color" href="/docs/runtime/common-component-attributes/label-color/" badge="advanced" tone="muted" />

### `show-if`

<AttributeReference label="show-if" href="/docs/runtime/common-component-attributes/show-if/" badge="advanced" tone="muted" />

### `hide-if`

<AttributeReference label="hide-if" href="/docs/runtime/common-component-attributes/hide-if/" badge="advanced" tone="muted" />

## Component Methods

The following component methods are available when an [`id`](/docs/runtime/common-component-attributes/id/) is assigned to the component and `component.multipleChoiceChecklist({id:'my-id'})` is called from JS/TS:

### `clear`

Clear the selected option(s) of the `multiple-choice-checklist`.

### `scrollIntoView`

Programmatically scroll until the `multiple-choice-checklist` is visible in the view.

### `selectItem`

Select an item by its label of the list of options of the `multiple-choice-checklist`.

**main.view\.xml**

```xml
<var name="favorite_colors" type="multiple-choice">
    <option key="green">Green</option>
    <option key="red">Red</option>
    <option key="yellow">Yellow</option>
</var>

<multiple-choice-checklist id="my-checklist" bind="favorite_colors" label="Favorite Colors" />

```

**main.js**

```javascript
function select() {
    component.multipleChoiceChecklist({id: 'my-checklist'}).selectItem('Yellow');
}
```

### `selectItemByIndex`

Select an item by its index of the list of options of the `multiple-choice-checklist`. **Note**: Indexes begin at 1.

**main.view\.xml**

```xml
<var name="favorite_colors" type="multiple-choice">
    <option key="green">Green</option>
    <option key="red">Red</option>
    <option key="yellow">Yellow</option>
</var>

<multiple-choice-checklist id="my-checklist" bind="favorite_colors" label="Favorite Colors" />

```

**main.js**

```javascript
function select() {
    component.multipleChoiceChecklist({id: 'my-checklist'}).selectItemByIndex(2);
    // Selects "Red"
}
```
