Headless rich text editor built on ProseMirror with extensible architecture for building custom editors
94
Build a simple text formatting toolbar that allows users to apply and remove formatting to selected text in a rich text editor.
Your toolbar should support the following formatting operations:
The toolbar should be implemented as a function that accepts an editor instance and returns an object with methods to:
toggleBold() on text without bold formatting applies bold formatting @testtoggleBold() on text that is already bold removes bold formatting @testtoggleItalic() applies italic formatting to unformatted text @testclearFormatting() removes all formatting marks from the selected text @testisBoldActive() method returns true when the selection contains bold text @testisItalicActive() method returns true when the selection contains italic text @test@generates
import { Editor } from '@tiptap/core';
export interface Toolbar {
toggleBold(): void;
toggleItalic(): void;
clearFormatting(): void;
isBoldActive(): boolean;
isItalicActive(): boolean;
}
export function createToolbar(editor: Editor): Toolbar;Provides the rich text editor framework.
Provides basic editor functionality including bold and italic marks.
Install with Tessl CLI
npx tessl i tessl/npm-tiptap--coredocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10