This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/document-authoring/editing-and-review/spellcheck.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Use spellcheck in Document Authoring

Before you start, ensure the Document Authoring library is installed and running. Refer to the getting started guide.

Document Authoring supports in-editor spellcheck for these languages:

  • en-US
  • en-GB
  • fr-FR
  • de-DE

Spellcheck is disabled by default. You can enable it when creating the editor or later at runtime.

The example code omits error handling. Add it before using this code in production.

Enable spellcheck when creating the editor

Use UIOptions.spellcheck.language to set the initial spellcheck language:

const editor = await docAuthSystem.createEditor(
document.getElementById('editor'),
{
ui: {
spellcheck: { language: 'en-US' },
},
},
);

After the editor loads, spellcheck checks the document with the configured dictionary and underlines misspelled words.

Enable or switch spellcheck at runtime

Use editor.enableSpellcheck(language) to turn spellcheck on or switch to a supported language:

editor.enableSpellcheck('fr-FR');
editor.enableSpellcheck('de-DE');

enableSpellcheck() returns immediately. Misspelled words begin to be underlined shortly after the selected dictionary loads.

Disable spellcheck

Use editor.disableSpellcheck() to turn spellcheck off:

editor.disableSpellcheck();

Disabling spellcheck removes the current misspelled-word underlines and stops checking new edits.

Build a spellcheck toggle

Connect spellcheck to your own controls so users can choose a language or turn it off:

const editor = await docAuthSystem.createEditor(
document.getElementById('editor'),
);
const languageSelect = document.getElementById('spellcheck-language');
languageSelect.addEventListener('change', (event) => {
const value = event.target.value;
if (value === 'off') {
editor.disableSpellcheck();
return;
}
editor.enableSpellcheck(value);
});

The corresponding HTML for the language selector could look like this:

<select id="spellcheck-language">
<option value="off">Off</option>
<option value="en-US">English (US)</option>
<option value="en-GB">English (UK)</option>
<option value="fr-FR">French</option>
<option value="de-DE">German</option>
</select>

Spellcheck and self-hosted assets

If you use the default CDN-hosted SDK assets, nothing extra is required.

If you self-host Document Authoring assets, make sure the spellcheck dictionary assets are hosted under the same asset base path as the rest of the SDK assets. Spellcheck loads dictionary files from these paths:

  • spellcheck/en-US.dat
  • spellcheck/en-GB.dat
  • spellcheck/fr-FR.dat
  • spellcheck/de-DE.dat

If these files are missing from your self-hosted asset bundle, spellcheck won’t load for those languages.

Learn more