Aa 0.14.1

Slash and block menus

Nothing is drawn beside a block: / opens the kinds of block, and ⌘/ the commands of the block the caret is in.

The slash menu

Press Enter at the end of the last line, type /, then a few letters to narrow it: /head, /todo, /table.

What it stores

Type / at the start of a block, or after a space, and the menu opens under the block. The letters typed after it narrow the commands to those whose name or keywords hold them; when none do, it says No matching commands. A command run takes the slash and its letters out of the text and does its work, one step to undo. Deleting the slash closes the menu.

The menu does not open in code or in a table. An empty paragraph says nothing of its own; blockPlaceholder gives it words.

CommandMakes
TextA paragraph.
Heading 1, Heading 2, Heading 3#, ##, ###
To-do- [ ]
Bulleted list, Numbered list-, 1.
Quote>
CodeA fenced code block.
Divider---
Callout> [!💡], Notion’s box with its icon; a type word, > [!note], is a Markdown alert
Toggle, Toggle heading 1, 2 and 3A folded callout, > [!note]-, with or without a heading.
TableA table of two columns.
EquationA $$ block.
ColumnsTwo empty columns side by side: see Columns.
TabsTwo empty tabs, <tabs> around a <tab name="…"> each; see Tabs.
DiagramWith the diagram atom: see Diagrams.
Image or fileWith onFiles: the browser’s file picker.

The product’s own commands follow these.

The block menu

Put the caret in a block and press ⌘/ for its commands: another kind, Duplicate, Move up, Delete.

What it stores

⌘/ opens the commands of the block the caret is in, over the block, and selects it. A right click in a table opens them at the pointer.

CommandWhat it does
The kinds aboveTurn the block into another kind. Its words stay, except in a divider, which has none.
DuplicateA copy after it, ⌘D.
DeleteTakes it away.
Move up, Move down⌘⇧↑ and ⌘⇧↓.
Indent, OutdentIn a list only, as Tab and Shift-Tab.
Add row, Delete row, Add column, Delete columnIn a table only.
The product’s blockCommandsAfter the editor’s own.
WordsThe number of words in the document, last; a screen reader also hears the characters.

Commands that do not apply to the block are left out. To act on several blocks at once, select them and use the keys: see Selecting and moving.

KeyIn a menu
↓, ↑The next or the previous command, round from the last to the first.
EnterRuns the command.
EscapeCloses the menu.
⌘⌥0 to ⌘⌥8Turn the block into Text, Heading 1, 2 or 3, To-do, Bulleted list, Numbered list, Quote or Code, without the menu.

A press outside the menu closes it too.

The menu is Design system 1’s Context menu, four squares wide whatever its words: words too long fade over their last square. Each row is one square high, its words on the lower sixteen and its icon at the row’s end. Its commands scroll within eight squares, and Close, with esc beside it, stays under them. It stands under its block, or over it when the window or a phone’s keyboard leaves no room under it.

OptionDefaultWhat it does
menustruefalse turns off the slash menu, the block menu, the empty block’s placeholder and moving blocks by hand.
commandsNoneMore commands for the slash menu, after the kinds.
blockCommandsNoneMore commands for the block menu.
blockPlaceholderNothingWhat an empty paragraph with the caret says; '' for nothing.
createEditor(host, {  commands: [    { id: 'today', label: 'Today’s date', icon: 'text', keywords: 'date now', run: editor => {      const at = editor.selection()      if (at) editor.replace(at.start, at.end, new Date().toLocaleDateString())    } },  ],  blockCommands: [    { id: 'share', label: 'Copy link to block', icon: 'link', run: editor => copyBlockLink(editor.activeBlock()) },  ],})

A command is { id, label, icon, keywords?, ink?, enabled?, run(editor) }: keywords are found by the slash menu as the label is, ink draws the icon in one of the text colours, and enabled(editor) returning false leaves the command out. See Commands.

Toolbar · Selecting and moving · Keyboard