> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: MultiSelectCheckbox Component

## Article: MultiSelectCheckbox Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/form/multi-select-checkbox-component.md

## Article Content:

# MultiSelectCheckbox

_Components/Form_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/multiselectcheckbox>

## Overview

```jsx
() => {
  const [selectedOptions, setSelectedOptions] = React.useState([]);

  return (
    <Box align="center">
      <Box width="30%" direction="vertical">
        <FormField label="Country">
          <MultiSelectCheckbox
            placeholder="Select"
            options={[
              { value: 'Argentina', id: 'Argentina' },
              { value: 'Bolivia', id: 'Bolivia' },
              { value: 'China', id: 'China' },
              { value: 'Denmark', id: 'Denmark' },
              { value: 'Germany', id: 'Germany' },
              { value: 'Hungary', id: 'Hungary' },
              { value: 'Italy', id: 'Italy' },
              { value: 'Kenya', id: 'Kenya' },
              { value: 'Jordania', id: 'Jordania' },
            ]}
            selectedOptions={selectedOptions}
            onSelect={(option) =>
              setSelectedOptions([...selectedOptions, option])
            }
            onDeselect={(option) =>
              setSelectedOptions(
                selectedOptions.filter((item) => item !== option),
              )
            }
          />
        </FormField>
      </Box>
    </Box>
  );
};
```

MultiSelectCheckbox allows to select multiple items from a predefined list of options.

### Do

- Use it to select multiple items from a list of options.
- Use it as a filter for data sets.

### Don't

- Don't use it to select a single item only. Use `<Dropdown/>` instead.
- Don't use it if user should be able to add new values to the list as well. Use `<Multiselect/>` instead.

### Feature examples

#### Size

Adjust the component `size` using the size prop. It supports 3 sizes:

- `large` - use it in onboarding flows, where the field needs emphasis.
- `medium` (default) - use in all common cases.
- `small` - use in more dense and narrow layouts.

```jsx
() => {
  const options = [
    { value: 'Option 1', id: '1' },
    { value: 'Option 2', id: '2' },
    { value: 'Option 3', id: '3' },
    { value: 'Option 4', id: '4' },
    { value: 'Option 5', id: '5' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox size="large" placeholder="Large" options={options} />
      <MultiSelectCheckbox
        size="medium"
        placeholder="Medium"
        options={options}
      />
      <MultiSelectCheckbox size="small" placeholder="Small" options={options} />
    </StorybookComponents.Stack>
  );
};
```

#### Border

Style the component using the `border` prop. It supports 4 styles:

- `standard` (default) - use in forms.
- `round` - use when the component is used as a filter.
- `bottomLine` - use as a title which can be edited on the click.
- `none` - use in Content Manager's spreadsheet cell.

```jsx
() => {
  const options = [
    { value: 'Option 1', id: '1' },
    { value: 'Option 2', id: '2' },
    { value: 'Option 3', id: '3' },
    { value: 'Option 4', id: '4' },
    { value: 'Option 5', id: '5' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox
        border="standard"
        placeholder="Standard"
        options={options}
      />
      <MultiSelectCheckbox
        border="round"
        placeholder="Round"
        options={options}
      />
      <MultiSelectCheckbox
        border="bottomLine"
        placeholder="Bottom line"
        options={options}
      />
      <MultiSelectCheckbox border="none" placeholder="None" options={options} />
    </StorybookComponents.Stack>
  );
};
```

#### Status

Control the component status using a `status` prop. It supports 3 states:

- `error` - use to highlight an invalid selection.
- `warning` - use to highlight a value that impacts the user or that can't be validated.
- `loading` - use to show that the value is being uploaded to the server.

```jsx
() => {
  const options = [
    { value: 'Option 1', id: '1' },
    { value: 'Option 2', id: '2' },
    { value: 'Option 3', id: '3' },
    { value: 'Option 4', id: '4' },
    { value: 'Option 5', id: '5' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox
        status="error"
        placeholder="Error"
        options={options}
      />
      <MultiSelectCheckbox
        status="warning"
        placeholder="Warning"
        options={options}
      />
      <MultiSelectCheckbox
        status="loading"
        placeholder="Loading"
        options={options}
      />
    </StorybookComponents.Stack>
  );
};
```

#### Status message

Add text that explains the status or what action the user should take with the `statusMessage` prop.

Showing the status message inline, directly below the component is preferred in all default cases.

- To add an accessible inline message, wrap the component in a `<FormField/>` and add the `statusMessage`.
- To add a status message in a tooltip that requires users to hover on the icon, use the `statusMessage` prop. Control tooltip placement with `tooltipPlacement` prop.

View more inline status message examples in `<FormField/>`.

```jsx
() => {
  const options = [
    { value: 'Option 1', id: '1' },
    { value: 'Option 2', id: '2' },
    { value: 'Option 3', id: '3' },
    { value: 'Option 4', id: '4' },
    { value: 'Option 5', id: '5' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <StorybookComponents.Stack flexDirection="column" gap="12px">
        <Text secondary>For all default cases:</Text>
        <FormField status="error" statusMessage="This is an error message.">
          <MultiSelectCheckbox
            placeholder="See message below"
            tooltipPlacement="top-end"
            options={options}
          />
        </FormField>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack flexDirection="column" gap="12px">
        <Text secondary>For narrow layouts only:</Text>
        <MultiSelectCheckbox
          placeholder="Hover on status icon"
          status="error"
          statusMessage="This is an error message."
          tooltipPlacement="top-end"
          options={options}
        />
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Disabled

Disable all input interactions with `disabled` prop. Use to highlight unavailable functions.

```jsx
() => {
  const options = [
    { value: 'Option 1', id: '1' },
    { value: 'Option 2', id: '2' },
    { value: 'Option 3', id: '3' },
    { value: 'Option 4', id: '4' },
    { value: 'Option 5', id: '5' },
  ];

  return (
    <MultiSelectCheckbox placeholder="Disabled" disabled options={options} />
  );
};
```

#### Affix

Support the input value with additional information added to the `prefix` and `suffix` props.

These areas can contain text, icons and even badges.

```jsx
() => {
  const options = [
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox
        placeholder="Select"
        prefix={<Input.Affix>Prefix</Input.Affix>}
        suffix={<Input.Affix>Suffix</Input.Affix>}
        options={options}
      />
      <MultiSelectCheckbox
        placeholder="Select"
        prefix={
          <Input.IconAffix>
            <Icons.Languages />
          </Input.IconAffix>
        }
        suffix={
          <Input.IconAffix>
            <Badge>Badge</Badge>
          </Input.IconAffix>
        }
        options={options}
      />
    </StorybookComponents.Stack>
  );
};
```

#### Clear button

Enable a button that clears the dropdown value by using `clearButton` prop. Show it when the field value is optional or needs to be cleared.

```jsx
() => {
  const [selectedOptions, setSelectedOptions] = React.useState([0]);
  const options = [{ id: 0, value: 'Click clear button to remove selection' }];

  return (
    <MultiSelectCheckbox
      placeholder="Select"
      clearButton
      onClear={() => setSelectedOptions([])}
      onSelect={(option) => setSelectedOptions([Number(option)])}
      selectedOptions={selectedOptions}
      options={options}
    />
  );
};
```

#### Fixed header and footer

Add related actions to `fixedFooter` or `fixedHeader` areas. Areas keep their position on scroll.

```jsx
() => {
  const options = [
    { id: 1, value: 'Option 1' },
    { id: 2, value: 'Option 2' },
    { id: 3, value: 'Option 3' },
    { id: 4, value: 'Option 4' },
    { id: 5, value: 'Option 5' },
  ];

  return (
    <MultiSelectCheckbox
      placeholder="Select"
      fixedHeader={<ListItemAction title="Fixed Header" />}
      fixedFooter={<ListItemAction title="Fixed Footer" />}
      options={options}
    />
  );
};
```

#### List item builders

Build custom options layouts with:

- `listItemSectionBuilder` - use to group items into sections by type. See `<ListItemSection/>` for more details.
- `listItemActionBuilder` - use to add text button for related list actions, i.e. 'Manage categories'. See `<ListItemAction/>` for more details.
- `listItemSelectBuilder` - use to build custom list designs. See `<ListItemSelect/>` for more details.

```jsx
() => {
  const listItemSectionOptions = [
    listItemSectionBuilder({
      id: 'section-1',
      type: 'title',
      title: 'Section 1',
    }),
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
    listItemSectionBuilder({
      id: 'divider',
      type: 'divider',
    }),

    listItemSectionBuilder({
      id: 'section-2',
      type: 'title',
      title: 'Section 2',
    }),
    { id: 3, value: 'Option 4' },
    { id: 4, value: 'Option 4' },
  ];

  const listItemActionOptions = [
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
    { id: 3, value: 'Option 4' },
    listItemActionBuilder({
      id: 'action',
      title: 'Action',
    }),
  ];

  const listItemSelectOptions = [
    listItemSelectBuilder({
      id: 0,
      prefix: <Avatar size="size30" />,
      title: 'Title',
      subtitle: 'Subtitle',
      suffix: 'Suffix',
      checkbox: true,
    }),
    listItemSelectBuilder({
      id: 1,
      prefix: <Avatar size="size30" />,
      title: 'Title',
      subtitle: 'Subtitle',
      suffix: 'Suffix',
      checkbox: true,
    }),
    listItemSelectBuilder({
      id: 2,
      prefix: <Avatar size="size30" />,
      title: 'Title',
      subtitle: 'Subtitle',
      suffix: 'Suffix',
      checkbox: true,
    }),
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox
        placeholder="List Item Section"
        options={listItemSectionOptions}
      />
      <MultiSelectCheckbox
        placeholder="List Item Action"
        options={listItemActionOptions}
      />
      <MultiSelectCheckbox
        placeholder="List Item Select"
        options={listItemSelectOptions}
      />
    </StorybookComponents.Stack>
  );
};
```

#### List container dimensions

Control the container size for options with:

- `maxHeightPixels` - use to specify maximum height for longer lists.
- `dropdownWidth` - set width to 'auto' or 'max-content' to match content width or specify it in pixels.
- `minWidthPixels` - use to increase dropdown popover width manually.

By default, the dropdown matches the input field width.

```jsx
() => {
  const options = [
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
    { id: 3, value: 'Option 4' },
    { id: 4, value: 'Option 5' },
    { id: 5, value: 'Option 6' },
    { id: 6, value: 'Option 7' },
    { id: 7, value: 'Option 8' },
  ];

  return (
    <StorybookComponents.Stack>
      <MultiSelectCheckbox
        placeholder="Select"
        maxHeightPixels="200px"
        dropdownWidth="auto"
        minWidthPixels="400px"
        options={options}
        popoverProps={{
          placement: 'bottom-start',
        }}
      />
    </StorybookComponents.Stack>
  );
};
```

#### Marked option

Control what to highlight with a hover state once the dropdown is opened with the `markedOption` prop.

```jsx
<MultiSelectCheckbox
  placeholder="Select"
  markedOption={1}
  options={[
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
  ]}
/>;
```

#### Delimiter

Specify what character to use to separate selected options with the `delimiter` prop.

```jsx
() => {
  const options = [
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
    { id: 3, value: 'Option 4' },
  ];

  return (
    <StorybookComponents.Stack flexDirection="column">
      <MultiSelectCheckbox
        placeholder="Select"
        selectedOptions={[0, 1, 2]}
        delimiter=", "
        options={options}
      />
      <MultiSelectCheckbox
        placeholder="Select"
        selectedOptions={[0, 1, 2]}
        delimiter=";  "
        options={options}
      />
    </StorybookComponents.Stack>
  );
};
```

#### Lazy loading

Indicate that options are loading from a server or load a large list of items gradually with the `infiniteScroll`, `loadMore` and `hasMore` props.

```jsx
() => {
  const [selectedOptions, setSelectedOptions] = React.useState([]);

  const [data, setData] = React.useState([]);
  const fetchMoreData = () =>
    Promise.resolve(
      fetch(`/api/dropdown?limit=${5}&offset=${data.length}`),
    ).then((results) => setData([...data, ...results]));

  React.useEffect(() => {
    fetchMoreData();
  }, []);

  return (
    <MultiSelectCheckbox
      placeholder="Select"
      options={data}
      infiniteScroll
      hasMore={true}
      loadMore={fetchMoreData}
      selectedOptions={selectedOptions}
      onSelect={(option) => setSelectedOptions([...selectedOptions, option])}
      onDeselect={(option) =>
        setSelectedOptions(selectedOptions.filter((item) => item !== option))
      }
    />
  );
};
```

#### Text overflow

Control text overflow for:

- The field itself: set the `textOverflow` prop either to clip or ellipsis.
- The dropdown layout: it wraps longer values by default. In order to have ellipses, select the items that have to be rendered with the `listItemSelectBuilder`.

```jsx
() => {
  const options = [
    { id: 0, value: 'Option 1' },
    { id: 1, value: 'Option 2' },
    { id: 2, value: 'Option 3' },
    { id: 3, value: 'Option 4' },
    { id: 4, value: 'Option 5' },
  ];
  const longOptions = [
    {
      id: 0,
      value: 'This is a long value that make dropdown layout grow',
    },
    {
      id: 1,
      value: 'This is a long value that make dropdown layout grow',
    },
    {
      id: 2,
      value: 'This is a long value that make dropdown layout grow',
    },
  ];
  const longOptionsWithEllipsis = [
    listItemSelectBuilder({
      id: 0,
      title: 'This is a long value that make dropdown layout grow',
      ellipsis: true,
      checkbox: true,
    }),
    listItemSelectBuilder({
      id: 1,
      title: 'This is a long value that make dropdown layout grow',
      ellipsis: true,
      checkbox: true,
    }),
    listItemSelectBuilder({
      id: 2,
      title: 'This is a long value that make dropdown layout grow',
      ellipsis: true,
      checkbox: true,
    }),
  ];
  return (
    <StorybookComponents.Stack flexDirection="column">
      <StorybookComponents.Stack>
        <FormField label="Input value - ellipsis">
          <MultiSelectCheckbox
            options={options}
            selectedOptions={[0, 1, 2, 3, 4]}
            placeholder="This field is showing ellipsis at the end of this line"
            textOverflow="ellipsis"
          />
        </FormField>
        <FormField label="Input value - clip">
          <MultiSelectCheckbox
            options={options}
            selectedOptions={[0, 1, 2, 3, 4]}
            placeholder="This field is clipping content at the end of this line"
            textOverflow="clip"
          />
        </FormField>
      </StorybookComponents.Stack>
      <StorybookComponents.Stack>
        <FormField label="Options - wrapping">
          <MultiSelectCheckbox options={longOptions} placeholder="Select" />
        </FormField>
        <FormField label="Options - with ellipsis">
          <MultiSelectCheckbox
            options={longOptionsWithEllipsis}
            placeholder="Select"
          />
        </FormField>
      </StorybookComponents.Stack>
    </StorybookComponents.Stack>
  );
};
```

#### Selected items value

Customize how the selected values are represented inside of an input.

```jsx
() => {
  const [state, setState] = React.useState({
    selectedOptions: [0, 1, 2, 3, 4],
    inputValue: 'All items selected',
  });
  const getInputValue = (selectedOptions) => {
    if (selectedOptions.length === optionsList.length) {
      return 'All items selected';
    }
    return selectedOptions
      .map((id) => optionsList.find((option) => option.id === id).value)
      .join(', ');
  };
  const onSelect = (optionId) => {
    const selectedOptions = [...state.selectedOptions, optionId];
    setState({ selectedOptions, inputValue: getInputValue(selectedOptions) });
  };
  const onDeselect = (optionId) => {
    const selectedOptions = state.selectedOptions.filter(
      (item) => item !== optionId,
    );
    setState({ selectedOptions, inputValue: getInputValue(selectedOptions) });
  };
  const optionsList = [
    { value: 'Option 1', id: 0 },
    { value: 'Option 2', id: 1 },
    { value: 'Option 3', id: 2 },
    { value: 'Option 4', id: 3 },
    { value: 'Option 5', id: 4 },
  ];
  return (
    <MultiSelectCheckbox
      options={optionsList}
      selectedOptions={state.selectedOptions}
      onSelect={onSelect}
      onDeselect={onDeselect}
      value={state.inputValue}
    />
  );
};
```

### Common use case examples

#### Form element

Use MultiSelectCheckbox in forms to apply multiple values.

```jsx
() => {
  const serviceOptions = [
    { id: 0, value: 'Web design' },
    { id: 1, value: 'Branding' },
    { id: 2, value: 'SEO' },
    { id: 3, value: 'Web development' },
    { id: 4, value: 'Marketing' },
  ];
  const businessOptions = [
    { id: 0, value: 'Agency' },
    { id: 1, value: 'Freelancer' },
    { id: 2, value: 'Other' },
  ];
  const renderServiceMultiSelect = () => {
    const [selectedOptions, setSelectedOptions] = React.useState([1, 2]);
    return (
      <FormField label="What services do you offer?">
        <MultiSelectCheckbox
          options={serviceOptions}
          selectedOptions={selectedOptions}
          onSelect={(option) =>
            setSelectedOptions([...selectedOptions, Number(option)])
          }
          onDeselect={(option) =>
            setSelectedOptions(
              selectedOptions.filter((item) => item !== option),
            )
          }
        />
      </FormField>
    );
  };
  const renderBusinessDropdown = () => {
    const [selected, setSelected] = React.useState(1);
    return (
      <FormField label="What best describes your business?" required>
        <Dropdown
          placeholder="Select"
          selectedId={selected}
          options={businessOptions}
          onSelect={(option) => setSelected(Number(option.id))}
        />
      </FormField>
    );
  };
  const renderBusinessLogoUpload = (
    <FormField label="Business Logo" infoContent="Minimum size 300 x 100 px">
      <FileUpload onChange={() => {}}>
        {({ openFileUploadDialog }) => (
          <Box width="200px" height="132px">
            <AddItem
              theme="image"
              tooltipContent="Upload Logo"
              onClick={openFileUploadDialog}
            >
              Add Item
            </AddItem>
          </Box>
        )}
      </FileUpload>
    </FormField>
  );
  const renderMainBusinessInfoFields = (
    <Layout cols={1}>
      <FormField label="Business Name" required>
        <Input placeholder="Type your business name" />
      </FormField>
      <FormField label="Business Site URL">
        <Input placeholder="https://www.mybusinesswebsite.com" />
      </FormField>
    </Layout>
  );
  return (
    <Card>
      <Card.Header
        title="Business Details"
        subtitle="These details will be used for emailing, invoicing, and more."
      />
      <Card.Divider />
      <Card.Content>
        <Layout>
          <Cell span={8}>{renderMainBusinessInfoFields}</Cell>
          <Cell span={4}>{renderBusinessLogoUpload}</Cell>
          <Cell>
            <Divider />
          </Cell>
          <Cell>
            <Heading size="small">More Details</Heading>
          </Cell>
          <Cell>
            <Layout>
              <Cell span={6}>{renderBusinessDropdown()}</Cell>
              <Cell span={6}>{renderServiceMultiSelect()}</Cell>
            </Layout>
          </Cell>
        </Layout>
      </Card.Content>
    </Card>
  );
};
```

#### List item builders for advanced filters

Build custom layouts within a list item builder for advanced filters.

```jsx
() => {
  const [filterOptions, setFilterOptions] = React.useState({
    filterBy: [],
    selectedOptions: [],
  });

  const authorOptions = [
    listItemSectionBuilder({
      id: 'in-house',
      type: 'title',
      title: 'In-house',
    }),
    { id: 0, value: 'Christian Mills' },
    { id: 1, value: 'Etta Wheeler' },
    { id: 2, value: 'Paul Simons' },
    listItemSectionBuilder({
      id: 'divider',
      type: 'divider',
    }),

    listItemSectionBuilder({
      id: 'contributors',
      type: 'title',
      title: 'Contributors',
    }),
    { id: 3, value: 'Robert Ortega' },
    { id: 4, value: 'Mary James' },
  ];

  const [items, setItems] = React.useState([
    {
      id: 0,
      title: 'Getting a grasp on adventure',
      author: 'Christian Mills',
      contributor: 'Robert Ortega',
      date: 'Jan 26, 2021',
      checked: false,
    },
    {
      id: 1,
      title: '10 tips for relaxation',
      author: 'Etta Wheeler',
      contributor: 'Mary James',
      date: 'Jun 9, 2020',
      checked: false,
    },
    {
      id: 2,
      title: 'Performance standards for digital trust and safety',
      author: 'Paul Simons',
      contributor: 'Mary James',
      date: 'Sep 12, 2020',
      checked: false,
    },
    {
      id: 3,
      title: 'Getting a grasp on adventure',
      author: 'Christian Mills',
      contributor: 'Robert Ortega',
      date: 'Jan 26, 2021',
      checked: false,
    },
  ]);

  const onAuthorFilterSelect = (id) => {
    setFilterOptions({
      selectedOptions: [...filterOptions.selectedOptions, id],
      filterBy: [
        ...filterOptions.filterBy,
        authorOptions.find((item) => item.id === id).value,
      ],
    });
  };

  const onAuthorFilterDeselect = (id) => {
    const selectedOptions = filterOptions.selectedOptions.filter(
      (item) => item !== id,
    );

    setFilterOptions({
      filterBy: selectedOptions.map(
        (id) => authorOptions.find((author) => author.id === id).value,
      ),
      selectedOptions,
    });
  };

  const renderAddToCategory = () => {
    const [shown, setShown] = React.useState(false);
    const [categories, setCategories] = React.useState([
      {
        id: 0,
        title: 'Getting started',
        checked: false,
      },
      {
        id: 1,
        title: 'Your Community',
        checked: false,
      },
    ]);

    return (
      !isAllUnchecked() && (
        <Popover
          showArrow
          shown={shown}
          appendTo="viewport"
          placement="bottom"
          width="250px"
          onClickOutside={() => setShown(false)}
        >
          <Popover.Element>
            <TextButton
              size="small"
              prefixIcon={<Icons.Tag />}
              onClick={() => setShown(!shown)}
            >
              Add to Category
            </TextButton>
          </Popover.Element>
          <Popover.Content>
            <Box
              backgroundColor="D80"
              direction="vertical"
              gap="SP2"
              padding="SP3"
            >
              <Text light secondary size="small">
                Categories
              </Text>
              {categories.map((category) => (
                <Checkbox
                  checked={category.checked}
                  onChange={() =>
                    setCategories(
                      categories.map((item) =>
                        item.id === category.id
                          ? { ...category, checked: !category.checked }
                          : item,
                      ),
                    )
                  }
                >
                  {category.title}
                </Checkbox>
              ))}
              <Divider />
              <Box align="space-between" paddingTop="SP2">
                <Button
                  skin="inverted"
                  size="small"
                  onClick={() => setShown(false)}
                >
                  Cancel
                </Button>
                <Button size="small" onClick={() => setShown(false)}>
                  Apply
                </Button>
              </Box>
            </Box>
          </Popover.Content>
        </Popover>
      )
    );
  };

  const renderAuthorsSelect = () =>
    isAllUnchecked() && (
      <MultiSelectCheckbox
        value="All authors"
        size="small"
        dropdownWidth="240px"
        maxHeightPixels="400px"
        border="round"
        options={authorOptions}
        popoverProps={{
          placement: 'bottom-start',
        }}
        selectedOptions={filterOptions.selectedOptions}
        onSelect={onAuthorFilterSelect}
        onDeselect={onAuthorFilterDeselect}
      />
    );

  const renderTableItem = (item) => {
    return (
      <TableListItem
        checkbox
        checked={item.checked}
        onCheckboxChange={() =>
          setItems(
            items.map((currentItem) =>
              currentItem.id === item.id
                ? { ...item, checked: !item.checked }
                : currentItem,
            ),
          )
        }
        showDivider
        options={[
          { value: <Image />, width: '90px' },
          {
            value: (
              <Box direction="vertical" gap="3px">
                <Text>{item.title}</Text>
                <Text size="tiny" secondary>
                  {item.date} • {item.author}
                </Text>
              </Box>
            ),
          },
          {
            width: '20%',
            value: (
              <TableActionCell
                primaryAction={{
                  text: 'Edit',
                  skin: 'standard',
                  onClick: () => {},
                }}
              />
            ),
          },
        ]}
      />
    );
  };

  const renderTableItems = () => {
    if (filterOptions.filterBy.length === 0) {
      return items.map((item) => renderTableItem(item));
    }

    const filtered = items.filter((item) =>
      filterOptions.filterBy.find(
        (filter) => filter === item.author || filter === item.contributor,
      ),
    );
    return filtered.map((item) => renderTableItem(item));
  };

  const isAllChecked = () =>
    items.filter((item) => item.checked).length === items.length;
  const isAllUnchecked = () =>
    items.filter((item) => item.checked).length === 0;

  const toggleAll = (checked) =>
    setItems(items.map((item) => ({ ...item, checked })));

  return (
    <Card>
      <Card.Header
        title={
          <Checkbox
            onChange={() => {
              isAllChecked() ? toggleAll(false) : toggleAll(true);
            }}
            checked={isAllChecked()}
          >
            Select all
          </Checkbox>
        }
        suffix={
          <>
            {renderAuthorsSelect()}
            {renderAddToCategory()}
          </>
        }
      />
      <Card.Divider />
      {renderTableItems()}
    </Card>
  );
};
```

## Code

```jsx
import { MultiSelectCheckbox } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `ariaControls` | `string` | — | Associate a control with the regions that it controls. |
| `ariaDescribedby` | `string` | — | Associate a region with its descriptions. Similar to aria-controls but instead associating descriptions to the region and description identifiers are separated with a space. |
| `ariaLabel` | `string` | — | Define a string that labels the current element in case where a text label isn't visible on the screen. |
| `ariaRoledescription` | `string` | — | Sets the `aria-roledescription` attribute of the `<input>` element, giving assistive technologies a readable description of its role. |
| `autocomplete` | `string` | `'off'` | Sets the value of the native `autocomplete` attribute of the input. |
| `autoFocus` | `boolean` | — | Focus the element on mount (standard React input autoFocus) |
| `autoSelect` | `boolean` | — | Automatically selects the entire input text. |
| `backgroundColor` | `string` | — | Sets the background color of the input. Accepts any CSS color value. |
| `border` | `"none" \| "standard" \| "round" \| "bottomLine"` | — | Control the border style of input. |
| `children` | `ReactNode` | — |  |
| `clearButton` | `boolean` | — | Displays clear button (X) on a non-empty input. |
| `clearButtonAriaLabel` | `string` | — | Aria label for the clear button. |
| `clearButtonTooltipContent` | `ReactNode` | — | When provided, hovering displays a tooltip with this content. |
| `clearButtonTooltipProps` | `TooltipCommonProps` | — | Clear button tooltip props. |
| `closeOnSelect` | `boolean` | `true` | Closes DropdownLayout on option selection. |
| `customDropdownContent` | `ReactNode` | — | Accepts any content to render in the dropdown instead of the options list. Ignored when `native` is `true`. |
| `customInput` | `ReactNode \| Function` | — | Render a custom input instead of the default html input tag. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `defaultValue` | `string \| number` | — | Defines the initial value of an input. |
| `delimiter` | `string` | `', '` | Specifies the delimiter symbol to be displayed between the selected options in the input. |
| `disabled` | `boolean` | — | Specifies whether input should be disabled or not. |
| `disableEditing` | `boolean` | — | Restricts input editing. |
| `dropDirectionUp` | `boolean` | — | Specifies whether the list opens upward. Aligns the list container to the bottom and positions the arrow for upward direction. |
| `dropdownOffsetLeft` | `string` | `'0'` | Sets the offset of the dropdown from the left. |
| `dropdownWidth` | `string` | `null` | Sets the width of the dropdown. |
| `emptyStateMessage` | `ReactNode` | — | Defines a message to be displayed instead of options when no options exist or no options pass the predicate filter function. |
| `enableSearch` | `boolean` | `false` | Sets whether to enable search in the dropdown. |
| `enterKeyHint` | `"search" \| "enter" \| "done" \| "go" \| "next" \| "previous" \| "send"` | — | Sets the label of the virtual keyboard's enter key on touch devices. |
| `fixedFooter` | `ReactNode` | — | A fixed footer to the list. |
| `fixedHeader` | `ReactNode` | — | A fixed header to the list. |
| `focusOnClearClick` | `boolean` | — | Specifies whether to focus the field when clear button is clicked. |
| `focusOnOption` | `string \| number` | — | Marks (not selects) and scrolls view to the option on opening the dropdown by option id. |
| `focusOnSelectedOption` | `boolean` | — | Scroll view to the selected option on opening the dropdown. |
| `getSelectedOptionsText` | `(selectedOptionsCount: number) => string` | — | Defines a callback function to get the text for the selected options. |
| `hasMore` | `boolean` | — | Whether there are more items to be loaded. |
| `hideStatusSuffix` | `boolean` | — | Specifies whether status suffix should be hidden. |
| `highlight` | `boolean` | — | Mark in bold word parts based on search pattern. |
| `id` | `string` | — | Assigns a unique identifier for the root element. |
| `inContainer` | `boolean` | — | Whether the `<DropdownLayout/>` is in a container component. If `true`, some styles such as shadows, positioning and padding are added to the component contentContainer. |
| `infiniteScroll` | `boolean` | — | Set this prop for lazy loading of the dropdown layout items. |
| `inputElement` | `ReactElement` | — | Use a customized input component instead of the default |
| `inputmode` | `string` | — | Sets the value of the native `inputmode` attribute, which tells mobile browsers which on-screen keyboard to show, for example `numeric` or `email`. |
| `inputRef` | `null \| (instance: HTMLInputElement \| null) => void \| RefObject<HTMLInputElement>` | — | Ref to the underlying `<input>` DOM element. Accepts callback and object refs. Use for input masking libraries such as `use-mask-input`. Memoize callback refs to avoid reattaching on every render. |
| `itemHeight` | `"big" \| "small"` | `'small'` | Controls the minimum height of options that aren't builder options. |
| `listboxId` | `string` | — | Defines the id for the listbox. |
| `listType` | `"select" \| "action"` | — | Defines type of behavior applied in list. |
| `loadMore` | `(page: number) => void` | — | A callback called when more items are requested to be rendered. |
| `markedOption` | `string \| number \| false \| true` | — | Sets the default hover behavior when: 1. `false` means no default 2. `true` means to hover the first selectable option 3. Any number/string represents the id of option to hover |
| `max` | `number` | — | Sets a maximum value of an input. Similar to html5 max attribute. |
| `maxHeightPixels` | `string \| number` | — | Set the max height of the dropdownLayout in pixels. |
| `maxLength` | `number` | — | Sets the maximum number of characters that can be inserted to a field. |
| `menuArrow` | `boolean` | — | Specifies whether input should have a dropdown menu arrow on the right side. |
| `min` | `number` | — | Sets a minimum value of an input. Similar to HTML5 min attribute. |
| `minWidthPixels` | `string \| number` | — | Set the min width of the dropdownLayout in pixels. |
| `name` | `string` | — | Reference element data when a form is submitted. |
| `native` | `boolean` | `false` | Indicates whether to render using the native select element. |
| `noLeftBorderRadius` | `boolean` | — | Specifies whether input shouldn't have rounded corners on its left. |
| `noRightBorderRadius` | `boolean` | — | Specifies whether input shouldn't have rounded corners on its right. |
| `onBlur` | `FocusEventHandler` | — | Defines a standard input onBlur callback. |
| `onChange` | `ChangeEventHandler` | — | Defines a standard input onChange callback. |
| `onClear` | `(event: KeyboardEvent<HTMLButtonElement> \| MouseEvent<HTMLButtonElement, MouseEvent>) => void` | — | Displays clear button (X) on a non-empty input and calls a callback function. |
| `onClickOutside` | `(e: MouseEvent \| TouchEvent) => void` | — | Defines a callback function which is called when the user clicks or touches outside the list while it's visible. |
| `onClose` | `() => void` | — | Callback function called whenever the user press the `Escape` keyboard. |
| `onCompositionChange` | `(isComposing: boolean) => void` | — | Defines a callback function called on compositionstart/compositionend events. |
| `onCopy` | `ClipboardEventHandler<HTMLInputElement>` | — | Defines a callback handler that is called when user copies text to a clipboard (using a mouse or keyboard shortcut) |
| `onDeselect` | `(id: string \| number, option: DropdownLayoutValueOption) => void` | — | Defines a callback function called on option deselect. Function receives the id of the unselected option as the first argument, and the actual option object as the second argument. |
| `onDrillIn` | `(option: DropdownLayoutValueOption) => void` | — | Called when the user presses ArrowRight on a hovered option. Use to move focus into an interactive child element (e.g. an actions menu). |
| `onDrillOut` | `() => void` | — | Called when the user navigates back from a drilled-in child element (e.g. via ArrowLeft or Escape). Use to restore focus to the trigger input. |
| `onEnterPressed` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a callback handler that is called when the user presses -enter-. |
| `onEscapePressed` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a callback handler that is called when the user presses -escape-. |
| `onFocus` | `FocusEventHandler` | — | Defines a standard input onFocus callback. |
| `onInputClicked` | `MouseEventHandler` | — | Defines a standard input onClick callback. |
| `onKeyDown` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a standard input onKeyDown callback. |
| `onKeyUp` | `KeyboardEventHandler<HTMLInputElement>` | — | Defines a standard input onKeyUp callback. |
| `onManuallyInput` | `ManualInputFnSignature` | — | A callback which is called when the user performs a Submit-Action. Submit-Action triggers are: "Enter", "Tab", [typing any defined delimiters], Paste action. `onManuallyInput(values: Array<string>): void - The array of strings is the result of splitting the input value by the given delimiters |
| `onMouseDown` | `MouseEventHandler` | — | Callback function called whenever the user clicks the dropdown layout. |
| `onMouseEnter` | `MouseEventHandler` | — | Callback function called whenever the user entered with the mouse to the dropdown layout. |
| `onMouseLeave` | `MouseEventHandler` | — | Callback function called whenever the user exited with the mouse from the dropdown layout. |
| `onOptionMarked` | `(option: DropdownLayoutValueOption \| null, optionElementId?: string \| undefined) => void` | — | Callback function called whenever an option becomes focused (hovered/active). Receives the relevant option object from the original props.options array. |
| `onOptionsHide` | `() => void` | — | A callback which is called when options dropdown is hidden. |
| `onOptionsNavigate` | `(option: DropdownLayoutValueOption \| null) => void` | — | Callback function called whenever the user navigates to an option (via keyboard or mouse). Receives the relevant option object from the original props.options array, or null when navigation is cleared. |
| `onOptionsShow` | `() => void` | — | A callback which is called when options dropdown is shown. |
| `onPaste` | `ClipboardEventHandler<HTMLInputElement>` | — | Defines a callback handler that is called when user pastes text from a clipboard (using a mouse or keyboard shortcut) |
| `onSelect` | `MultiSelectOnSelectFnSignature` | — | Defines a callback function which is called when the user selects an option from the list. When `highlight` is `true`, it receives the original option from `options`. |
| `options` | `DropdownLayoutOption[]` | — | Array of objects: - id `<string / number>` *required*: the id of the option, should be unique. - value `<function / string / node>` *required*: can be a string, react element or a builder function. - disabled `<bool>` *default value- false*: whether this option is disabled or not - linkTo `<string>`: when provided, the option is an anchor to the given value - title `<bool>`  *default value- false*  **deprecated**: use `listItemSectionBuilder` to render a title instead. - overrideStyle `<bool>` *default value- false*  **deprecated**: use `overrideOptionStyle` to override option styles instead. - overrideOptionStyle `<bool>` *default value- false* - when set to `true`, the option is responsible for its own styles. No styles are applied from the DropdownLayout itself. - label `<string>`: the string displayed within an input when the option is selected. This is used when using `<DropdownLayout/>` with an `<Input/>`. |
| `overflow` | `"visible" \| "hidden" \| "auto" \| "scroll"` | — | Set overflow of container. |
| `pattern` | `string` | — | Sets a pattern that typed value must match to be valid (regex) |
| `placeholder` | `string` | — | Sets a placeholder message to display. |
| `popoverProps` | `PopoverCommonProps` | — | Accepts common popover props that are passed to the options dropdown popover. |
| `predicate` | `(option: DropdownLayoutValueOption) => boolean` | — | Defines a custom function for options filtering. |
| `prefix` | `ReactNode` | — | Pass a component you want to show as the prefix of the input, e.g., text, icon. |
| `readOnly` | `boolean` | — | Specifies whether input is read only. |
| `required` | `boolean` | — | Specifies whether input is mandatory. |
| `role` | `string` | — | Specifies the role of the input element for accessibility. |
| `rtl` | `boolean` | — | Specifies text direction. If true, the text is displayed from right to left. |
| `scrollbar` | `"fixed" \| "overlay"` | — | Controls which type of scrollbar to render. |
| `scrollToOption` | `string \| number` | — | Scrolls to the specified option when dropdown is opened without marking it. |
| `selectedHighlight` | `boolean` | `true` | Whether the selected option is highlighted when the dropdown reopens. |
| `selectedId` | `string \| number` | — | The id of the selected option in the list. |
| `selectedOptions` | `(string \| number \| undefined)[]` | — | Specifies an array of selected options ids. |
| `showDrawerOnMobile` | `boolean` | `true` | Controls whether to show drawer on mobile devices. |
| `showOptionsIfEmptyInput` | `boolean` | `true` | Controls whether to show options if input is empty. |
| `size` | `"small" \| "tiny" \| "medium" \| "large"` | `'medium'` | Controls the size of the input and its dropdown options. `tiny` and `small` inputs render `small` options, the rest render `medium` ones. |
| `status` | `"error" \| "warning" \| "loading"` | — | Specify the status of a field. |
| `statusMessage` | `ReactNode` | — | Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed. |
| `statusMessageTooltipProps` | `TooltipCommonProps` | — | Status message tooltip props. |
| `step` | `number` | — | Specifies the interval between number values. |
| `suffix` | `ReactNode` | — | Pass a component you want to show as the suffix of the input, e.g., text, icon. |
| `tabIndex` | `number` | — | Indicates that element can be focused and where it participates in sequential keyboard navigation. |
| `textOverflow` | `"ellipsis" \| "clip"` | — | Handles text overflow behavior. It can either `clip` (default) or display `ellipsis`. |
| `tooltipPlacement` | `"right" \| "left" \| "top" \| "bottom" \| "auto" \| "auto-start" \| "auto-end" \| "top-start" \| "top-end" \| "right-start" \| "right-end" \| "bottom-end" \| "bottom-start" \| "left-end" \| "left-start"` | — | Controls placement of a status tooltip. |
| `type` | `string` | — | Specifies the type of `<input/>` element to display. Default is text. |
| `value` | `string \| number` | — | Specifies the current value of the element. |
| `valueParser` | `(option: DropdownLayoutValueOption) => ReactNode \| RenderOptionFn` | — | Function that receives an option, and should return the value to be displayed. |
| `visible` | `boolean` | — | Should show or hide the component. |
| `withArrow` | `boolean` | — | Displays an arrow on the list container while it's visible. |
| `withSelection` | `boolean` | — |  |

## Testkit

No testkit for this component — it doesn't expose a unidriver testkit.

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.323.0** (2026-09-10) — maintenance release, no component-specific changes
- **1.320.0** (2026-09-03) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.289.0** (2026-06-17) — maintenance release, no component-specific changes
- **1.278.0** (2026-05-08) — maintenance release, no component-specific changes
- **1.271.0** (2026-04-22) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.244.0** (2026-01-02) — maintenance release, no component-specific changes
- **1.213.0** (2025-08-19) — maintenance release, no component-specific changes
- **1.190.0** (2025-05-22) — maintenance release, no component-specific changes
- **1.186.0** (2025-05-05) — maintenance release, no component-specific changes
- **1.185.0** (2025-04-30) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.124.0** (2024-09-06) — maintenance release, no component-specific changes
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.114.0** (2024-07-11) — feat: add the ability to search ([#13914](invalid-url))
- **1.114.0** (2024-07-11) — fix: check `getSelectedOptionsText` prop exists ([#13935](invalid-url))
- **1.98.0** (2024-03-15) — maintenance release, no component-specific changes
- **1.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes