# ViewRootElementDefinition

interface

A description of the DOM element used as an editor's editable root, accepted by [`config.root.element`](module_core_editor_editorconfig-RootConfig.md#member-element).

```typescript
const element: ViewRootElementDefinition = {
	name: 'h1',
	classes: [ 'article-title' ],
	styles: { 'font-weight': 'bold' },
	attributes: { 'data-id': '123' }
};
```

`class` and `style` may also be passed as strings inside `attributes` as a shorthand:

```typescript
const element: ViewRootElementDefinition = {
	name: 'h1',
	attributes: { class: 'article-title', style: 'font-weight: bold' }
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/editorconfig.ts#L1580)

<a id="properties">

## Properties

<a id="member-attributes">

### `attributes?: Record<string, string>`

Additional DOM attributes to apply to the editable element.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/editorconfig.ts#L1601)

<a id="member-classes">

### `classes?: string | Array<string>`

Class name or array of class names to apply to the editable element. Each name can be provided as a string.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/editorconfig.ts#L1591)

<a id="member-name">

### `name?: string`

The DOM tag name to use. Defaults to `'div'` when not provided, so integrators can keep the default element and still specify [`classes`](#member-classes), [`styles`](#member-styles), or [`attributes`](#member-attributes).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/editorconfig.ts#L1586)

<a id="member-styles">

### `styles?: Record<string, string>`

Inline styles to apply to the editable element as a record of style properties.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/editorconfig.ts#L1596)

---

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