---
title: "AddListItemCmd | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/AddListItemCmd/"
---

# AddListItemCmd

> The command to add a new list item to the current cursor position.

## Classes

### AddListItemCmd

#### Remarks

there must be no other items of the same list between the current index and the index of the previous list item.

#### Extends

- [`ListCmd`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ListCmd.md#abstract-listcmd)

#### Implements

- [`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand)

#### Constructors

##### Constructor

```ts
new AddListItemCmd(textManager, initData): AddListItemCmd;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `textManager` | [`ITextManager`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ITextManager.md#itextmanager) |
| `initData` | [`AddListItemCmdData`](#addlistitemcmddata) |

###### Returns

[`AddListItemCmd`](#addlistitemcmd)

###### Overrides

[`ListCmd`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ListCmd.md#abstract-listcmd).[`constructor`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ListCmd.md#constructor)

#### Methods

##### execute()

```ts
execute(): boolean;
```

Executes the command.

###### Returns

`boolean`

true if changes were made, false otherwise.

###### Implementation of

[`ICommand`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#icommand).[`execute`](https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-text/ICommand.md#execute)

***

### AddListItemCmdData

Data required to initialize the command.

#### Constructors

##### Constructor

```ts
new AddListItemCmdData(previousListItemIndex): AddListItemCmdData;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `previousListItemIndex` | `number` |

###### Returns

[`AddListItemCmdData`](#addlistitemcmddata)

#### Properties

##### previousListItemIndex

```ts
previousListItemIndex: number;
```

The paragraph index of the the previous list item.
