# image/imagestyle/utils

module

<a id="constants">

## Constants

<a id="constant-DEFAULT_DROPDOWN_DEFINITIONS">

### `DEFAULT_DROPDOWN_DEFINITIONS: Array<ImageStyleDropdownDefinition>`

Default drop-downs provided by the plugin that can be referred in the [`toolbar`](module_image_imageconfig-ImageConfig.md#member-toolbar) configuration. The drop-downs are containers for the [image style options](module_image_imageconfig-ImageStyleConfig.md#member-options).

If both of the `ImageEditing` plugins are loaded, there are 2 predefined drop-downs available:

* **`'imageStyle:wrapText'`**, which contains the `alignLeft` and `alignRight` options, that is, those that wraps the text around the image,
* **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is, those that breaks the text around the image.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/src/imagestyle/utils.ts#L166)

<a id="constant-DEFAULT_ICONS">

### `DEFAULT_ICONS: Record<string, string>`

Default image style icons provided by the plugin that can be referred in the [`styles`](module_image_imageconfig-ImageConfig.md#member-styles) configuration.

See [`icon`](module_image_imageconfig-ImageStyleOptionDefinition.md#member-icon) to learn more.

There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/src/imagestyle/utils.ts#L143)

<a id="constant-DEFAULT_OPTIONS">

### `DEFAULT_OPTIONS: Record<string, ImageStyleOptionDefinition>`

Default image style options provided by the plugin that can be referred in the [`styles`](module_image_imageconfig-ImageConfig.md#member-styles) configuration.

There are available 5 styles focused on formatting:

* **`'alignLeft'`** aligns the inline or block image to the left and wraps it with the text using the `image-style-align-left` class,
* **`'alignRight'`** aligns the inline or block image to the right and wraps it with the text using the `image-style-align-right` class,
* **`'alignCenter'`** centers the block image using the `image-style-align-center` class,
* **`'alignBlockLeft'`** aligns the block image to the left using the `image-style-block-align-left` class,
* **`'alignBlockRight'`** aligns the block image to the right using the `image-style-block-align-right` class,

and 3 semantic styles:

* **`'inline'`** is an inline image without any CSS class,
* **`'block'`** is a block image without any CSS class,
* **`'side'`** is a block image styled with the `image-style-side` CSS class.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/src/imagestyle/utils.ts#L43)

<a id="constant-utils">

### `utils: object`

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/src/imagestyle/utils.ts#L389)

<a id="functions">

## Functions

<a id="function-getStyleDefinitionByName">

### `getStyleDefinitionByName( name, styles ) → ImageStyleOptionDefinition | undefined` _(internal)_

Returns the style with a given `name` from an array of styles.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-image/src/imagestyle/utils.ts#L183)

#### Parameters

* `name: string`
* `styles: Array<ImageStyleOptionDefinition>`

#### Returns

* `ImageStyleOptionDefinition | undefined`

---

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