Create a comment annotation anchored to the text range from a TextSelectedEvent.
React / Next.js
Other Frameworks
askAi
Send a text-generation prompt to any AI model via Velt’s proxy. The provider is resolved automatically from the model name prefix (gpt-*/o1-*/o3-*/o4-* → OpenAI, claude-* → Anthropic, gemini-* → Gemini).
React / Next.js
Other Frameworks
enableRewriter
React / Next.js
Other Frameworks
Subscribe to Rewriter events. Supports 'textSelected' to receive a TextSelectedEvent whenever a user selects text in a Rewriter-enabled region.
React / Next.js
Other Frameworks
replaceText
Replace the DOM text identified by a TextSelectedEvent with new text.
React / Next.js
Other Frameworks
textSelected does not fire, and replaceText() returns success: false, for a selection inside TipTap or another ProseMirror-based editor.
enableDefaultUI
Show or hide the built-in Velt rewriter toolbar. Calling disableDefaultUI() suppresses the toolbar on text selection while keeping all rewriter events active, so you can render a fully custom UI. Call enableDefaultUI() to restore the default toolbar.
React / Next.js
Other Frameworks