# Editor Layout Build a rich text editor with toolbars, slash commands, mentions, and drag-and-drop. ## When to use - Note-taking apps, CMS editors - Collaborative editing interfaces - Any rich text editing need (supports JSON, HTML, and Markdown) ## Component tree ``` UEditor ├── UEditorToolbar (fixed / bubble / floating) ├── UEditorDragHandle ├── UEditorSuggestionMenu ├── UEditorMentionMenu └── UEditorEmojiMenu ``` ## Basic editor ```vue ``` > If you encounter prosemirror-related errors, add prosemirror packages to `vite.optimizeDeps.include` in `nuxt.config.ts`. ## Key components - `UEditor` — rich text editor. `v-model` accepts JSON (default), HTML, or Markdown via `content-type` prop. Default slot provides `{ editor, handlers }` — `editor` is the Tiptap instance, `handlers` contains action functions for toolbar/menus. - `UEditorToolbar` — toolbar with `layout`: `'fixed'` (default), `'bubble'` (on selection), `'floating'` (on empty lines). - `UEditorDragHandle` — block drag-and-drop handle. - `UEditorSuggestionMenu` — slash command menu (type `/` to open). - `UEditorMentionMenu` — `@` mention menu. - `UEditorEmojiMenu` — emoji picker (type `:` to open). ## Toolbar modes ```vue ``` ## Content types ```vue ``` ## With document sidebar Combine with Dashboard layout for a multi-document editor: ```vue [layouts/editor.vue] ``` ```vue [pages/editor/[id].vue] ```