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

# SetAlignmentCmd

> The command to set text alignment for the current cursor position or selected text.

## Classes

### SetAlignmentCmd

#### Implements

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

#### Constructors

##### Constructor

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

###### Parameters

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

###### Returns

[`SetAlignmentCmd`](#setalignmentcmd)

#### 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)

***

### SetAlignmentCmdData

Data required to initialize the command.

#### Constructors

##### Constructor

```ts
new SetAlignmentCmdData(alignment): SetAlignmentCmdData;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `alignment` | `TextAlignment` |

###### Returns

[`SetAlignmentCmdData`](#setalignmentcmddata)

#### Properties

##### alignment

```ts
alignment: TextAlignment;
```

Text alignment type.
