SpellCheckingTextEditor

fun SpellCheckingTextEditor(spellChecker: EditorSpellChecker? = null, state: SpellCheckState = rememberSpellCheckState(spellChecker), modifier: Modifier = Modifier, contentPadding: PaddingValues = DefaultContentPadding, enabled: Boolean = true, autoFocus: Boolean = false, style: TextEditorStyle = rememberTextEditorStyle(), contextMenuStrings: ContextMenuStrings = ContextMenuStrings.Default, onRichSpanClick: RichSpanClickListener? = null)(source)

A drop-in text editor composable with integrated spell checking.

Wraps BasicTextEditor and overlays spell-check decorations driven by a SpellCheckState. Edits are observed reactively: affected spans are invalidated immediately and re-checked once typing goes quiet. Secondary clicks and taps on a flagged span open a context menu of Suggestions for the misspelled word or sentence-level Correction.

Parameters

spellChecker

The EditorSpellChecker backing spell checks; used to build a default state when none is provided. May be null to disable checking.

state

The SpellCheckState coordinating spell checking over the underlying TextEditorState. Defaults to a remembered state built from spellChecker.

modifier

The Modifier applied to the editor surface.

contentPadding

Padding applied around the editor content.

enabled

Whether the editor accepts input and focus.

autoFocus

Whether the editor requests focus on first composition.

style

The TextEditorStyle controlling appearance.

contextMenuStrings

Localized strings for the built-in context menu.

onRichSpanClick

Optional listener for clicks on non-spell-check rich spans; spell-check spans are handled internally.