Visual editor keys, commands, blocks and starters

v0.0.1

This page lists every keyboard shortcut, command, element, section and starter structure of the Mishka CMS visual editor. Use it to look up a name or a key. To learn the editor step by step, read Build a page in the visual editor.

On a Mac the shortcuts use ⌘ and ⇧. On Windows and Linux, use Ctrl in place of ⌘ and Shift in place of ⇧.

Keyboard shortcuts

The editor reads these keys on the canvas and on the panels around it.

KeysActionNotes
⌘ZUndoWorks while you type in a field.
⇧⌘ZRedoWorks while you type in a field.
⌘SSave the draft now (Save draft now)Writes the draft. It does not publish.
⌘CCopy the selected elementNeeds a selection.
⌘XCut the selected elementNeeds a selection.
⌘VPaste after the selected elementNeeds a selection.
⌘DDuplicate the selected element in placeNeeds a selection.
⇧⌘HHide the selected element from visitors, or show it againThe element stays in the page. ⌘H alone is left to the system.
Delete or BackspaceDelete the selected elementNeeds a selection.
⌘KOpen or close the command paletteSee the Commands section below.
⌘/Show or hide the code drawerThe drawer shows the generated source.
⌘PTurn preview on or offPreview turns the editor chrome off.
⇧1Fit to screen (Fit to screen)Sets the canvas zoom back to 100%. No ⌘ is needed.
EscClose the topmost layer, or clear the selectionCloses an open media preview first, then a folder form. Otherwise it clears the selection and the block you picked from the palette, and closes the open sheet.

These rules apply to every shortcut:

  • The editor reads the physical key, not the character it produces. ⌘Z is the key where Z sits on a US keyboard, so it works on a Persian or Russian layout as well.
  • While you type in a field, a text input or text you are editing on the canvas, the keys are left to the field. ⌘Z and ⇧⌘Z are the two exceptions.
  • A key held down acts once. The editor ignores auto-repeat.
  • With no element selected, a shortcut that needs one answers Select an element on the page first.

Gestures

GestureResult
Double-click text on the canvasEdits the text in place as plain text.
Enter, ⌘Enter or Esc while editing textFinishes the edit and keeps the text. Clicking outside the text does the same.
⇧Enter while editing textInserts a new line.
Double-click a node that a single click selects around, such as an expression or a commentSelects that node itself instead of the element around it.
⌘-click an element on the canvas, or a row in LayersHolds a second element beside the selection instead of replacing it.
Right-click an element on the canvas, or a row in LayersOpens the context menu, described below.
⌘Enter in the code drawer or the code windowApplies the markup or the CSS you typed, the same as the Apply button.

Commands

Press ⌘K to open the command palette. Its input reads Jump to a page, or run a command…. The palette has two lists. Actions holds the commands below, in this order. Go to holds the admin pages the signed-in account can open.

the command palette open over the editor, with the Actions list and its shortcut badges, and the Go to list below it

The command palette lists the editor's actions, then the admin pages you can reach.

CommandKeyShortcutWhat it does
Savesave⌘SWrites the draft.
PublishpublishNoneMakes this version live.
Undoundo⌘ZSteps back one change.
Redoredo⇧⌘ZSteps forward again.
Duplicate selectionduplicate⌘DCopies the selected element in place.
Hide or show for visitorstoggle_visibility⇧⌘HKeeps the selection in the page but shown to nobody, or shows it again.
Delete selectiondelete⌫Removes the selected element.
Toggle code drawertoggle_code⌘/Shows or hides the generated source.
Toggle previewtoggle_preview⌘PTurns the editor chrome off.

A plugin can add commands to this list on the builder:commands event. A command can name the permission that shows it, and the palette leaves out the ones the account does not hold. See Plugin events.

Context menu

The same menu opens from the canvas and from Layers. The groups are separated by lines.

GroupEntryShortcut
1Duplicate⌘D
1Hide from visitors⇧⌘H
1Wrap in a containerNone
1Make it a linkNone
2Copy⌘C
2Cut⌘X
2Paste after⌘V
3Copy stylesNone
3Paste stylesNone
4Save as snippetNone
4Delete⌫

Elements

The Blocks tab of the left panel lists elements first, grouped by category, then the sections. The tab has the search box Search elements and sections… and one filter chip per category. Click an element to arm it and then click where it goes, or drag it onto the canvas.

Every element is plain HTML with Tailwind classes, so it works on a site with no UI kit installed. Text elements arrive with placeholder words you type over. Containers arrive empty, and the canvas draws a dashed outline around an empty one while you edit.

Layout

ElementWhat you get
SectionA band across the page. The usual outermost wrapper.
ContainerCentred, width-capped, with side padding.
MainThe primary content of the page. Use one per page.
ArticleA self-contained piece, such as a post or a card body.
AsideContent beside the main thread, such as a sidebar.
HeaderIntroductory content for the page or a section.
FooterClosing content for the page or a section.
NavA group of navigation links.
BoxA plain div, for when nothing more specific fits.
2 columnsSide by side on desktop, stacked on mobile.
3 columnsThree across on desktop, stacked on mobile.
4 columnsFour across on desktop, stacked on mobile.
RowChildren in a line, vertically centred.
StackChildren one under the next, evenly spaced.
SpacerEmpty vertical room between two things.
DividerA horizontal rule.

Text

ElementWhat you get
H1The one top-level heading of the page.
H2A section heading.
H3A sub-section heading.
H4A fourth-level heading.
H5A fifth-level heading.
H6A sixth-level heading.
ParagraphA run of body copy.
LinkAn anchor. Set where it goes in the Inspector.
Bulleted listAn unordered list with three items.
Numbered listAn ordered list with three items.
QuoteA pulled quotation.

Media

ElementWhat you get
ImageAn image. Pick the file from Assets after you place it.
FigureAn image with a caption under it.

Forms

ElementWhat you get
FormA working form with one field. Rename it in the Inspector.
FieldsetGroups related fields under a legend.
LabelNames a field. Set its For to the id of that field.
Text inputA single line. Bound to the form it lands in.
Text areaSeveral lines. Bound to the form it lands in.
SelectOne choice from a list.
CheckboxA yes or no. It sends false when it is left unticked.
Radio groupOne choice from a few, all sharing one name.
Submit buttonSends the form to the handler of the page.

Dynamic

ElementOffered inWhat you get
Page contentLayouts onlyWhere the page that the layout wraps is rendered. Every layout needs one.
Component contentComponents onlyWhere whatever is put inside the component is rendered.
Property valueComponents onlyOne of the declared attributes of the component. Rename it in the Inspector.
ExpressionEvery documentAny Elixir expression the document can evaluate. Edit its source in the Inspector.

See Design the site layout for the Page content element and Add a form to a page for the form elements.

Sections

Below the elements, the Blocks tab lists whole sections under the heading Sections. A section arrives with sample copy that you edit down, and it drops in as one undoable step. Each one opens with a band tag, so it lands beside the other bands of the page.

SectionCategoryWhat you getOffered in
HeroHeaderA headline, a line of copy and two buttons.Every document
Features ×3ContentThree columns of title and text.Every document
Features ×4ContentA row of four cards with a title and a line each.Every document
Text + imageContentCopy on one side and a picture on the other.Every document
StatsContentThree numbers with labels.Every document
PricingCommerceThree plans, with the middle one highlighted.Every document
Call to actionFooterOne line and a button.Every document
Contact formFormsName, email and message, checked as the visitor types.Pages only
Fieldset groupFormsRelated fields under a legend, inside a form.Pages only
Newsletter signupFormsOne email field and a button on a line.Pages only
Subscribe boxFormsAn email field and a button that share one rounded border.Pages only
FooterFooterThree link columns and a line of small print.Every document

The form sections are bound to handlers that only a page can hold, so layouts, components and error pages do not offer them. A plugin can add elements and sections on the builder:elements and builder:blocks events.

Starters

A document with nothing in it opens on the starter chooser. The heading reads This page is empty, or This layout is empty, This error page is empty or This component is empty, and the text under it reads How do you want to start? Pick a structure and begin filling it in. Click a card to insert that structure. A structure is scaffolding with no copy in it.

the starter chooser on an empty page, with the four structure cards and the Start from scratch button at the bottom

The starter chooser appears on a document that has nothing on it yet.

StarterIdColumnsWhat you get
Single columnsingle1One wide band down the page.
Two columnstwo2A row that splits in half. It stacks on small screens.
Three columnsthree3A row that splits in thirds. It drops to two columns, then one, on smaller screens.
Hero + contenthero1A band across the top, then the page.

The button Start from scratch skips the structures. It leaves a single empty main element, tall enough to drop the first thing on. A plugin can add starters on the builder:page_starters event.