On this sectionFeature switches

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.

"Off" means the feature cannot be created, not that the content disappears. Each entry point for the group is removed and its shortcut, trigger or paste does nothing. Existing content of that type still renders, and can still be edited and deleted. The document schema does not change and nothing is removed from a document.

The groups

NameTypeDefaultDescription
mediabooleantrueImage, 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.
embedsbooleantrueEmbed and bookmark blocks in the slash menu and the Add menu. The URL paste menu offers neither option.
tablesbooleantrueThe table block in the slash menu, the Add menu and Turn into. A pasted HTML table becomes paragraphs.
columnsbooleantrueThe columns block in the slash menu and the Add menu. Pasted columns become paragraphs.
codebooleantrueThe code block in the slash menu, the Add menu and Turn into, and the ``` input rule. Pasted code blocks become paragraphs.
equationsbooleantrueThe block and inline equation in the slash menu and the Add menu, the Equation button in the selection toolbar, and Mod+Shift+E.
mentionsbooleantrueThe @ trigger and the slash Mention item. Pasted mentions become their names as text.
pageLinksbooleantrueThe page link block, its picker and the slash "Page link" item.
footnotesbooleantrueThe slash "Footnote" item. Pasted footnotes become text.
datesbooleantrueThe inline date insert, Mod+;. Pasted dates become their text.
emojibooleantrueThe : suggestions, and the closing :name: conversion.
tocbooleantrueThe table of contents block in the slash menu and the Add menu.
findbooleantrueThe find bar and Mod+F. The browser's own find opens instead.
slashMenubooleantrueThe slash menu. Typing "/" inserts the character only.
selectionToolbarbooleantrueThe floating toolbar over a text selection. The keyboard shortcuts for marks still work.
blockHandlebooleantrueThe 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.

tsx
"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.

tsx
"use client";

import { NotionLikeEditorBlock } from "@/components/blocks/notion-like-editor";

export function TextOnlyEditor() {
  return <NotionLikeEditorBlock documentId="notes" features={{ media: false, embeds: false }} />;
}

Related

  • Options for the finer tuning that is not a feature group
  • Props for the full list