How to Change Search Highlight Color in ASP.NET Core DOCX Editor

14 Aug 20261 minute to read

ASP.NET Core DOCX Editor (Document Editor) provides an option to change the default search highlight color using [searchHighlightColor] in Document Editor settings. The highlight color which is given in documentEditorSettings will be highlighted on the searched text. By default, the search highlight color is yellow.

Similarly, you can use the documentEditorSettings property for the DocumentEditor component also.

The following example code illustrates how to change the default search highlight color.

<ejs-documenteditorcontainer id="container" documentEditorSettings="settings" enableToolbar=true  height="590px"></ejs-documenteditorcontainer>

<script>
    var settings = { searchHighlightColor: 'Grey' };
</script>
public ActionResult Default()
{
    return View();
}

Output will be like below:

How to change the default search highlight color