# Blazor Editor Overview

The <a href="https://www.telerik.com/blazor-ui/editor" target="_blank">Blazor HTML Editor component</a> enables your users to create rich textual content through a What-You-See-Is-What-You-Get (WYSIWYG) interface and delivers a set of tools for creating, editing, and formatting text, paragraphs, lists, and other HTML elements.

## Creating Blazor Editor

1. Use the `TelerikEditor` tag to add the component to your Razor page.
2. Bind its `Value` to the `string` field you want to get the HTML content in.

<demo metaUrl="client/editor/overview/" height="520"></demo>

## Get/Set Content

The Blazor HTML Editor has a `Value` parameter, similar to other input components. Use the `Value` parameter to get or set the HTML string that shows inside the Editor content area.

An empty string is a valid initial Editor `Value`, but after the user interacts with the component, the minimal component `Value` is at least an empty element (usually `"<p></p>"`). Note that [the Editor and the browser treat empty paragraphs differently](https://www.telerik.com/blazor-ui/documentation/knowledge-base/editor-missing-br-in-value).

The Editor manages its content and `Value` depending on a [customizable schema](https://www.telerik.com/blazor-ui/documentation/components/editor/overview#prosemirror-schema-and-plugins). The component strips all other tags and attributes for compliance and security reasons.

## Security

The application must sanitize the content before passing it to the Editor and, optionally, before saving it to its storage after obtaining it from the Editor. It is up to the application to ensure there is no malicious content (such as input sanitization, XSS attack prevention and other security concerns).

## Validation

You can use the standard Data Annotation attributes to validate the content of the Editor. For the performance reasons listed above, validation happens with the `DebounceDelay` delay, not immediately on every keystroke, like simpler inputs. [See the Validation article for an example on how to validate the content of the Editor...](https://www.telerik.com/blazor-ui/documentation/common-features/input-validation#editor)

## Large Content Support

This section applies only to [Blazor **Server**](https://www.telerik.com/blazor-ui/documentation/getting-started/web-app) apps. Blazor **WebAssembly** apps do not require additional configuration for the Editor to work with large content.

[Blazor **Server**](https://www.telerik.com/blazor-ui/documentation/getting-started/web-app) apps use the **SignalR WebSocket** to send the Editor `Value` from the browser to the server .NET runtime and vice-versa. The default SignalR maximum message size is **32 KB**. To work with larger content (especially paste images as Base64 strings), [increase the max WebSocket message size for the Blazor application](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-increase-signalr-max-message-size).

## Resizing

The Editor allows you to resize:

#### Tables

Tables, their columns, and rows in the content area of Editor are resizable. To grab the resize handles, hover on the column or row borders.

#### Images

Images in the content area of the Editor are resizable. To grab the resize handles, hover on the borders of the image.

## Dependencies

The Telerik UI for [Blazor Editor](https://www.telerik.com/blazor-ui/editor) uses the ProseMirror engine and it depends on it. You do not need to add any extra assets or references yourself, though, we have taken care of everything internally.

## ProseMirror Schema and Plugins

The Editor uses a built-in [ProseMirror Schema](https://prosemirror.net/docs/guide/#schema) that includes most of the common HTML tags and a set of predefined [ProseMirror Plugins](https://prosemirror.net/docs/ref/#state.Plugin_System) for its basic functionalities. Find out how to customize the default ProseMirror [Schema](https://www.telerik.com/blazor-ui/documentation/components/editor/prosemirror-schema/overview) and [Plugins](https://www.telerik.com/blazor-ui/documentation/components/editor/prosemirror-plugins) to achieve the desired functionality in the Editor for Blazor.

## Editor Parameters

The following table lists Editor parameters, which are not discussed elsewhere in the component documentation.

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter         | Type and Default Value    | Description                                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Value`           | `string`                  | The value of the component. It supports two-way binding or alternatively, use it with the [`ValueChanged` event](https://www.telerik.com/blazor-ui/documentation/components/editor/events#valuechanged).                                                                                                                                                              |
| `DebounceDelay`   | `int` <br /> (`100`)      | The time in milliseconds that passes between updates on the `Value`. The default is `100ms` and if that causes performance issues with many repaints on your view, you can increase it. Since the editor is expected to handle longer editing sessions and larger content than regular inputs, we added this parameter to debounce the view-model updates and events. |
| `Adaptive`        | `bool`                    | Defines if the [toolbar](https://www.telerik.com/blazor-ui/documentation/components/editor/toolbar) should adapt to changes in the width of the component and automatically hide and show the overflowing items in a popup.                                                                                                                                           |
| `Width`           | `string`                  | Defines the width of the Editor. The default width is `null` but the themes apply `100%`.                                                                                                                                                                                                                                                                             |
| `Height`          | `string` <br /> (`250px`) | Defines the height of the Editor.                                                                                                                                                                                                                                                                                                                                     |
| `ReadOnly`        | `bool`                    | If set to `true`, the component will be readonly and will not allow user input. The component is not readonly by default and allows user input.                                                                                                                                                                                                                       |
| `AriaLabelledBy`  | `string`                  | Maps to the `aria-labelledby` attribute. Use this parameter to reference another element to define its accessible name.                                                                                                                                                                                                                                               |
| `AriaDescribedBy` | `string`                  | Maps to the `aria-describedby` attribute. Use this parameter to establish a relationship between widgets or groups and the text that describes them.                                                                                                                                                                                                                  |

## Editor Reference and Methods

The Editor provides methods for programmatic operation. To use them, obtain a reference to the component through its `@ref` attribute.

| Method         | Description                                                                                                                                                                                                                                                                                                                              |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ExecuteAsync` | Executes a [built-in Editor command programmatically](https://www.telerik.com/blazor-ui/documentation/components/editor/built-in-tools#programmatic-execution). You can also use this method to call built-in commands that are part of a [custom tool](https://www.telerik.com/blazor-ui/documentation/components/editor/custom-tools). |
| `FocusAsync`   | Focuses the editable area of the component. Always `await` this call, as it relies on `JSInterop`. Also check the dedicated KB article about [programmatic input component focusing](https://www.telerik.com/blazor-ui/documentation/knowledge-base/inputs-set-focus), which provides more examples and tips.                            |

> caption Paste in the Editor at the cursor position

<demo metaUrl="client/editor/overview/paste-in-editor/" height="400"></demo>

## Next Steps

* [Explore the Built-in Tools and Commands](https://www.telerik.com/blazor-ui/documentation/components/editor/built-in-tools)
* [Create Custom Tools](https://www.telerik.com/blazor-ui/documentation/components/editor/custom-tools)
* [Explore the Editor Edit Modes](https://www.telerik.com/blazor-ui/documentation/components/editor/edit-modes/overview)
* [Import and Export Data](https://www.telerik.com/blazor-ui/documentation/components/editor/import-export)
* [Learn more about the Editor Events](https://www.telerik.com/blazor-ui/documentation/components/editor/events)

## See Also

* [Live Demo: Editor](https://demos.telerik.com/blazor-ui/editor/overview)
* [Editor API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikeditor)
