AI assistant.
Review writing suggestions, or opt into local spelling and grammar checks on supported desktop Chrome.
Simulation uses simple rules to show the review flow. No AI model or service is called.
Local proofreading is off. Prepare the model, then enable checking.
Try this.
- Select a paragraph, press the AI button and choose Make shorter
- Choose Turn into a list on the second paragraph
- Put the caret at the end and choose Continue writing
- Accept a proposal, or discard it and nothing changes
- Choose On-device AI, prepare the model and enable local checking. Type “teh” in a paragraph, then review any corrections through the underline.
On-device AI needs a supported browser and device, and an initial model download. Local checking starts off. No automatic cloud fallback.
The code.
import { createRichTextEditor, standardPreset } from '@better-rich-text/core';
import { aiFeature, createAiPlugin, createOnDeviceAiModel } from '@better-rich-text/plugin-ai';
import { createProofingPlugin, onDeviceProvider } from '@better-rich-text/plugin-proofing';
const model = createOnDeviceAiModel();
const editor = createRichTextEditor('#editor', {
plugins: [
createAiPlugin({ model }),
createProofingPlugin({
providers: [onDeviceProvider({ model })],
language: 'en-AU', enabled: false, checkOnLoad: false,
}),
],
features: [...standardPreset.features, aiFeature],
toolbar: `ai | ${standardPreset.toolbar}`,
});
// Call directly from your explicit enable control's click handler.
async function enableLocalProofreading() {
await model.prepare();
editor.editor.execute('proofing.setEnabled', { enabled: true });
}