Features
- Fixed Toolbar: Persistent toolbar that sticks to the top of the editor
- Floating Toolbar: Contextual toolbar that appears on text selection
- Customizable Buttons: Easily add, remove, and reorder toolbar buttons
- Responsive Design: Adapts to different screen sizes and content
- Plugin Integration: Seamless integration with Plate plugins and UI components
Usage
Installation
The fastest way to add toolbar functionality is with the FixedToolbarKit and FloatingToolbarKit, which include pre-configured toolbar plugins along with their Plate UI components.
FixedToolbar: Renders a persistent toolbar above the editorFixedToolbarButtons: Pre-configured button set for the fixed toolbarFloatingToolbar: Renders a contextual toolbar on text selectionFloatingToolbarButtons: Pre-configured button set for the floating toolbar
Add Kit
import { createPlateEditor } from "platejs/react";
import { FixedToolbarKit } from "@/components/editor/plugins/fixed-toolbar-kit";
import { FloatingToolbarKit } from "@/components/editor/plugins/floating-toolbar-kit";
const editor = createPlateEditor({
plugins: [
// ...otherPlugins,
...FixedToolbarKit,
...FloatingToolbarKit,
],
});