Skip to content

Markdown Slides Editor Online

This guide is also a presentation, and it uses every layout and directive the slides plugin has. Read it as a document, open Source to edit it, or choose Present to turn the same Markdown into slides.

npm install @react-markdown-kit/renderer @react-markdown-kit/slides

One document, several slides

A line of three dashes, with a blank line on each side, starts a new slide. The rules separating this guide's sections are its slide breaks.

# The first slide

An idea worth sharing.

---

## The next slide

The details behind it.

This slide has no layout directive, so it uses default.


Layouts

<!-- layout: … --> picks one of nine: default, cover, section, center, two-cols, image-left, image-right, quote and fact. Each one has a slide in this deck.


Add the plugin

import Markdown from
  '@react-markdown-kit/renderer'
import { slides } from
  '@react-markdown-kit/slides/present'

<Markdown extensions={[slides()]}>
  {source}
</Markdown>

The root @react-markdown-kit/slides entry renders static slides. The /present entry adds presentation controls and keyboard navigation.

This is the two-cols layout. Everything after a ::right:: line goes in the second column.


Front matter sets the defaults

The --- block at the top of this file sets the title, a fade transition, the footer and page numbers for every slide. A slide's own directive wins over it.


A picture on the right

<!-- image: … --> gives the slide a picture, and image-right puts it on the right half.

The text keeps the other half. Without one of the two image layouts the picture isn't shown.


A picture on the left

image-left is the same slide mirrored. The picture fills its half and is cropped to fit.


Write the talk in the same file you'd send someone to read. The slides come from the headings and the breaks.

The quote layout makes a block quote the whole slide.


9

Layouts, one directive each. fact shows one number or word as big as it fits.


A background and some classes

<!-- background: … --> puts a picture behind the whole slide. <!-- class: … --> adds classes: inverse for light text on a dark surface and bottom to push the content down.

The other built-in classes are left, center, right, top and middle. Any other class is yours to style.


Reveal it in steps

A -- line reveals the next part on another keypress.

This paragraph is the first step.

And this one is the second. Speaker notes start at a ??? line and show in the presenter view.


Lists one item at a time

With <!-- incremental: true --> each item of a list is its own step.

  • Headings become slide titles
  • Lists turn into talking points
  • Fenced blocks stay code examples
  • Tables stay tables

Highlight code in steps

Put line ranges in braces after the fence's language. Each | is another step.

import { slides } from '@react-markdown-kit/slides/present'

const extensions = [
  gfm(),
  slides({ aspect: '16:9' }),
]

Keep using Markdown

Headings, paragraphs, bold text, lists, tables and code fences work inside a slide.

In your documentIn your presentation
A headingThe slide's title
A listYour talking points
A fenced blockA code example
A Markdown tableThe same table

A *** line stays a rule inside the slide. Use the same GFM preset in your editor and renderer to keep their syntax in sync.


Diagrams in a slide

This demo also loads the Mermaid plugin, so a mermaid fence renders as a diagram.

flowchart LR
  A[Markdown] --> B[Slides plugin] --> C[Deck]
  B --> D[PowerPoint]

Try presenting

Choose Present, then use the arrow keys to move through this guide. Press Escape to return to the document.

KeyAction
Right or SpaceNext slide or step
LeftPrevious slide or step
OOverview
PPresenter view
?Keyboard shortcuts

Share it

Open More for the presenter window, streaming playback, printing and PowerPoint export. Copy link shares the document without uploading it.

The slides reference covers every directive. This slide's own footer replaces the one from the front matter.