@editkit/ui
v2.0.4
Published
Trusted Types-compatible EditKit rich text editor UI kit — modular toolbar, slash commands, bubble menu, table controls, find & replace, light/dark themes, and lightweight content.css for saved HTML.
Maintainers
Keywords
Readme
EditKit Text Editor UI — Toolbar & Menus for the Rich Text Editor (@editkit/ui)
@editkit/ui provides the toolbar and visual components for EditKit Text Editor, a TypeScript WYSIWYG editor for React, Vue, Svelte, and vanilla JavaScript.
📦 Installation
npm install @editkit/ui @editkit/core
# or
pnpm add @editkit/ui @editkit/coreFor the all-in-one package, install editkit-text-editor and import the stylesheet from editkit-text-editor/styles.
🎨 Styles Import
import '@editkit/ui/styles';🚀 Components Included
createToolbar(editor, config)— Full formatting toolbar with granular feature propsBubbleMenu— Floating text selection bubble menuTableFloatingMenu— Contextual table actions menuImageFloatingMenu— Floating image resize barColorPickerPopover— 2D HSV color pickerEmojiPicker&SymbolPicker
Toolbar and floating-menu instances release their listeners when the editor is destroyed. You can also call each component's idempotent destroy() method when managing it independently.
Customization
Pass features to createToolbar() to keep the default UI while hiding individual controls, or pass typed items to append application-specific buttons. Items declared through core customToolbarItems or an extension's defineToolbarItems() are included automatically. Theme colors, spacing, and radii are exposed as scoped --editkit-* CSS variables.
Content safety
Content is sanitized by default with EditKit's DOMPurify-based policy. Use the sanitize editor option to adjust allowlists, pass your own sanitizer function, or false for trusted HTML. Sanitize again on your server before storing or rendering saved HTML. See Content safety.
📄 License
MIT © Ashikur Rahman
