Feature switches
Turn whole feature groups off with the features prop, from tables and media to the slash menu and block handle, without touching saved documents.
What the prop does
features turns groups of editor features off. Every group is on by default, so an editor with no features prop behaves as it always has. Only a false turns a group off: any other value, and any unknown key, is ignored.
The groups
| Name | Type | Default | Description |
|---|---|---|---|
| media | boolean | true | Image, video, audio and file blocks in the slash menu and the Add menu. Uploads: file paste and drop, and the upload tab of the media source popover. |
| embeds | boolean | true | Embed and bookmark blocks in the slash menu and the Add menu. The URL paste menu offers neither option. |
| tables | boolean | true | The table block in the slash menu, the Add menu and Turn into. A pasted HTML table becomes paragraphs. |
| columns | boolean | true | The columns block in the slash menu and the Add menu. Pasted columns become paragraphs. |
| code | boolean | true | The code block in the slash menu, the Add menu and Turn into, and the ``` input rule. Pasted code blocks become paragraphs. |
| equations | boolean | true | The block and inline equation in the slash menu and the Add menu, the Equation button in the selection toolbar, and Mod+Shift+E. |
| mentions | boolean | true | The @ trigger and the slash Mention item. Pasted mentions become their names as text. |
| pageLinks | boolean | true | The page link block, its picker and the slash "Page link" item. |
| footnotes | boolean | true | The slash "Footnote" item. Pasted footnotes become text. |
| dates | boolean | true | The inline date insert, Mod+;. Pasted dates become their text. |
| emoji | boolean | true | The : suggestions, and the closing :name: conversion. |
| toc | boolean | true | The table of contents block in the slash menu and the Add menu. |
| find | boolean | true | The find bar and Mod+F. The browser's own find opens instead. |
| slashMenu | boolean | true | The slash menu. Typing "/" inserts the character only. |
| selectionToolbar | boolean | true | The floating toolbar over a text selection. The keyboard shortcuts for marks still work. |
| blockHandle | boolean | true | The block handle, its Add button and grip, the block menu (Mod+/), and drag. Block selection and its keys still work. |
What happens to pasted content
A pasted node of an off type is read as its text, and a pasted media block is dropped the same way an unsupported image is. The paste menu, a file drop and the upload tab of the media source popover follow the same rules, so a user cannot get around the switch.
A comment-only editor
Turn off everything that is not text. What is left is paragraphs, headings, lists, quotes, marks and the link popover: enough for a comment that should never grow a table.
"use client";
import { NotionLikeEditorBlock } from "@/components/blocks/notion-like-editor";
export function CommentEditor() {
return (
<NotionLikeEditorBlock
documentId="comment-42"
features={{
media: false,
embeds: false,
tables: false,
columns: false,
code: false,
equations: false,
mentions: false,
pageLinks: false,
footnotes: false,
dates: false,
emoji: false,
toc: false,
}}
/>
);
}An editor with no media
Two flags are often enough. Media and embeds are the groups that need a host, so removing them removes the upload and preview adapters from the picture as well.
"use client";
import { NotionLikeEditorBlock } from "@/components/blocks/notion-like-editor";
export function TextOnlyEditor() {
return <NotionLikeEditorBlock documentId="notes" features={{ media: false, embeds: false }} />;
}