# AlignmentFormat

typedef

Available alignment options.

The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.

**Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should normally be able to choose depending on the [language of the editor content](../getting-started/setup/ui-language.md#setting-the-language-of-the-content).

```typescript
ClassicEditor
  .create( {
	alignment: {
	  options: [ 'left', 'right' ]
	}
  } )
  .then( ... )
  .catch( ... );
```

By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment, you can provide names of classes for each alignment option using the `className` property.

**Note:** Once you define the `className` property for one option, you need to specify it for all other options.

```typescript
ClassicEditor
  .create( {
	alignment: {
	  options: [
		{ name: 'left', className: 'my-align-left' },
		{ name: 'right', className: 'my-align-right' }
	  ]
	}
  } )
  .then( ... )
  .catch( ... );
```

See the demo of [custom alignment options](../features/text-alignment.md#configuring-alignment-options).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-alignment/src/alignmentconfig.ts#L71)

<a id="properties">

## Properties

<a id="member-className">

### `className?: string`

<a id="member-name">

### `name: AlignmentSupportedOption`

#### Value

`object`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
