Convert Figma logo to code with AI

jxnblk logomdx-deck

♠️ React MDX-based presentation decks

11,331
603
11,331
140

Top Related Projects

A React-based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.

67,545

The HTML Presentation Framework

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.

12,681

A simple, in-browser, markdown-driven slideshow tool.

32,981

A markdown parser and compiler. Built for speed.

32,612

Presentation Slides for Developers

Quick Overview

MDX-Deck is a powerful tool for creating presentation slides using MDX (Markdown + JSX). It allows users to create interactive and customizable presentations with React components, making it ideal for developers who want to create engaging slides with code examples and dynamic content.

Pros

  • Seamless integration of Markdown and React components
  • Highly customizable with themes and layouts
  • Built-in presenter mode and export options
  • Hot reloading for quick development and previewing

Cons

  • Steeper learning curve for non-developers
  • Limited built-in design options compared to traditional presentation software
  • Requires knowledge of React for advanced customization
  • May not be suitable for non-technical presentations

Code Examples

  1. Basic slide creation:
# Welcome to MDX-Deck

---

## This is a new slide

- Point 1
- Point 2
- Point 3

---

<CodeBlock language="javascript">
{`
const greeting = "Hello, World!";
console.log(greeting);
`}
</CodeBlock>
  1. Using a custom React component:
import React from 'react'
import { useDeck } from 'mdx-deck'

export const ProgressBar = () => {
  const state = useDeck()
  const progress = state.step / (state.length - 1)

  return (
    <div
      style={{
        position: 'fixed',
        bottom: 0,
        left: 0,
        right: 0,
        height: '5px',
        backgroundColor: '#ccc',
      }}
    >
      <div
        style={{
          height: '100%',
          backgroundColor: '#0066cc',
          width: `${progress * 100}%`,
        }}
      />
    </div>
  )
}
  1. Applying a custom theme:
// theme.js
export default {
  fonts: {
    body: 'Roboto, sans-serif',
    heading: 'Montserrat, sans-serif',
  },
  colors: {
    text: '#333',
    background: '#f5f5f5',
    primary: '#0066cc',
  },
  styles: {
    Slide: {
      padding: '2rem',
    },
  },
}

Getting Started

  1. Install MDX-Deck:
npm install mdx-deck
  1. Create a new MDX file (e.g., presentation.mdx):
# My Presentation

---

## Slide 1

Content for slide 1

---

## Slide 2

Content for slide 2
  1. Add a script to your package.json:
{
  "scripts": {
    "start": "mdx-deck presentation.mdx",
    "build": "mdx-deck build presentation.mdx"
  }
}
  1. Run the presentation:
npm start

Competitor Comparisons

A React-based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.

Pros of Spectacle

  • More feature-rich and customizable, offering a wider range of built-in components and themes
  • Better documentation and community support, with more examples and resources available
  • Easier integration with existing React applications

Cons of Spectacle

  • Steeper learning curve due to its more complex API and configuration options
  • Larger bundle size, which may impact load times for presentations
  • Less focused on Markdown-based content creation compared to mdx-deck

Code Comparison

mdx-deck:

import { Head, Notes } from 'mdx-deck'

# My Presentation

---

## Slide 2

<Notes>Speaker notes for slide 2</Notes>

Spectacle:

import { Deck, Slide, Heading, Text, Notes } from 'spectacle';

function Presentation() {
  return (
    <Deck>
      <Slide>
        <Heading>My Presentation</Heading>
      </Slide>
      <Slide>
        <Heading>Slide 2</Heading>
        <Text>Content for slide 2</Text>
        <Notes>Speaker notes for slide 2</Notes>
      </Slide>
    </Deck>
  );
}
67,545

The HTML Presentation Framework

Pros of reveal.js

  • More mature and widely adopted, with a larger community and ecosystem
  • Supports a wider range of features out-of-the-box, including PDF export and speaker notes
  • Offers more customization options and themes without requiring additional setup

Cons of reveal.js

  • Steeper learning curve, especially for users not familiar with HTML and CSS
  • Can be more complex to set up and configure compared to MDX-based alternatives
  • May require more manual work for content creation and slide organization

Code Comparison

reveal.js:

<div class="reveal">
  <div class="slides">
    <section>
      <h1>Slide Title</h1>
      <p>Slide content</p>
    </section>
  </div>
</div>

mdx-deck:

import { Head, Notes } from 'mdx-deck'

# Slide Title

Slide content

<Notes>Speaker notes</Notes>

The code comparison shows that reveal.js uses HTML structure for slides, while mdx-deck leverages MDX syntax, allowing for a more React-like approach to slide creation. This difference highlights the simplicity of mdx-deck for developers familiar with React and Markdown, while reveal.js offers a more traditional HTML-based structure that may be more familiar to web developers.

It's a presentation framework based on the power of CSS3 transforms and transitions in modern browsers and inspired by the idea behind prezi.com.

Pros of impress.js

  • More flexible and customizable for creating non-linear presentations
  • Supports 3D transformations and transitions
  • Wider browser compatibility, including older versions

Cons of impress.js

  • Steeper learning curve, requires more JavaScript knowledge
  • Less focused on content creation, more on presentation structure
  • Lacks built-in theming system

Code Comparison

impress.js:

<div id="impress">
    <div class="step" data-x="0" data-y="0">Slide 1</div>
    <div class="step" data-x="1000" data-y="500" data-rotate="90">Slide 2</div>
</div>

mdx-deck:

import { Deck } from 'mdx-deck'

<Deck>
  <h1>Slide 1</h1>
  ---
  <h1>Slide 2</h1>
</Deck>

Key Differences

  • impress.js uses HTML structure with data attributes for positioning and transitions
  • mdx-deck uses MDX (Markdown + JSX) for content creation and React components for slides
  • impress.js offers more control over slide positioning and transitions
  • mdx-deck provides a simpler, more content-focused approach to creating presentations

Both tools have their strengths, with impress.js excelling in creating visually dynamic presentations and mdx-deck offering a streamlined, developer-friendly experience for content-rich slides.

12,681

A simple, in-browser, markdown-driven slideshow tool.

Pros of remark

  • More established and mature project with a larger community
  • Supports a wider range of output formats (HTML, PDF, etc.)
  • Offers more customization options and plugins

Cons of remark

  • Steeper learning curve for beginners
  • Requires more setup and configuration
  • Less focused on creating slide decks specifically

Code Comparison

mdx-deck:

import { Head, Notes } from 'mdx-deck'

# My Presentation

---

## Slide 2

<Notes>Speaker notes for this slide</Notes>

remark:

class: center, middle

# My Presentation

---

## Slide 2

???

Speaker notes for this slide

Key Differences

  • mdx-deck uses MDX (Markdown + JSX) for content creation, allowing for easy integration of React components
  • remark uses a more traditional Markdown syntax with custom class annotations
  • mdx-deck is specifically designed for creating slide decks, while remark is a more general-purpose Markdown processor
  • remark requires additional setup for creating presentations, but offers more flexibility for other use cases

Both tools are powerful options for creating presentations, with mdx-deck being more focused on React-based slide decks and remark offering broader Markdown processing capabilities.

32,981

A markdown parser and compiler. Built for speed.

Pros of marked

  • Lightweight and fast Markdown parser
  • Extensive customization options for parsing and rendering
  • Widely adopted and battle-tested in various projects

Cons of marked

  • Limited to Markdown parsing and rendering
  • Lacks built-in presentation or slide deck functionality
  • Requires additional tools or frameworks for creating interactive presentations

Code comparison

mdx-deck:

import { Head, Notes } from 'mdx-deck'

# My Presentation

---

## Slide 2

<Notes>Speaker notes for this slide</Notes>

---

## Slide 3

marked:

const marked = require('marked');
const markdown = '# Heading\n\nSome **bold** and *italic* text.';
console.log(marked.parse(markdown));

mdx-deck is specifically designed for creating slide decks using MDX (Markdown + JSX), offering a more opinionated and feature-rich solution for presentations. It includes built-in components like Head and Notes for enhanced functionality.

marked, on the other hand, is a general-purpose Markdown parser and renderer. It focuses on converting Markdown to HTML and provides flexibility for customization. While it can be used as part of a presentation system, it doesn't offer presentation-specific features out of the box.

32,612

Presentation Slides for Developers

Pros of Slidev

  • Built with Vue.js, offering a more modern and flexible development experience
  • Supports live coding and interactive components within slides
  • Provides a wide range of built-in layouts and themes

Cons of Slidev

  • Steeper learning curve for those unfamiliar with Vue.js
  • Requires more setup and configuration compared to MDX-Deck
  • May have slower rendering performance for complex slides

Code Comparison

MDX-Deck:

import { Head, Notes } from 'mdx-deck'

# My Presentation

---

## Slide 2

<Notes>Speaker notes go here</Notes>

Slidev:

---
theme: seriph
---

# My Presentation

---

## Slide 2

<!-- Speaker notes go here -->

Both MDX-Deck and Slidev offer powerful features for creating presentations using markup languages. MDX-Deck focuses on simplicity and ease of use with Markdown and React, while Slidev provides a more feature-rich environment with Vue.js integration. The choice between the two depends on the user's familiarity with the respective ecosystems and the specific requirements of their presentation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

MDX Deck

Award-winning React MDX-based presentation decks

Build Status Version Downloads

View demo

Getting Started

npm i -D mdx-deck

Create an MDX file and separate each slide with ---.


# Hello

---

## This is my deck

---

## The End

Add a run script to your package.json with the MDX Deck CLI pointing to the .mdx file to start the development server:

"scripts": {
  "start": "mdx-deck deck.mdx"
}

Start the development server:

npm start

Use the left and right arrow keys to navigate through the presentation.

Using MDX

MDX uses Markdown syntax and can render React components inline with JSX.

Imports

To import components, use ES import syntax separated with empty lines between any markdown or JSX syntax.

import { Box } from 'theme-ui'

<Box color="tomato">Hello</Box>

Read more about MDX syntax in the MDX Docs.

Theming

MDX Deck uses Theme UI and Emotion for styling, making practically any part of the presentation themeable. It also includes several built-in themes to change the look and feel of the presentation.

Components

MDX Deck includes built-in components to help with creating presentations, a Notes component for adding speaker notes, a Head component for the document head, Header and Footer components for persistent header and footer content, and a Steps component for adding multiple intermediate steps in a single slide.

Read more in the Components docs.

Third-Party Components

These optional libraries are intended for use with MDX Deck.

  • CodeSurfer: React component for scrolling, zooming and highlighting code.
  • mdx-code: Runnable code playgrounds for MDX Deck.
  • mdx-deck-live-code: Live React and JS coding in slides.

Note: please check with version compatibility when using these libraries.

Layouts

Each slide can include a custom layout around its content, which can be used as a template for visually differentiating slides.

// example Layout.js
import React from 'react'

export default ({ children }) => (
  <div
    style={{
      width: '100vw',
      height: '100vh',
      backgroundColor: 'tomato',
    }}>
    {children}
  </div>
)
import Layout from './Layout'

# No Layout

---

<Layout>

# Custom Layout

</Layout>

The layout component will wrap the MDX elements within that slide, which means you can add custom layout styles or style child elements with CSS-in-JS.

Presenter Mode

Press Option + P to toggle Presenter Mode, which will show a preview of the next slide, a timer, and speaker notes.

presenter mode screenshot

The presentation can be opened in two separate windows at the same time, and it will stay in sync with the other window.

Keyboard Shortcuts

KeyDescription
Left Arrow, Page Up, Shift + SpaceGo to previous slide (or step in Steps)
Right Arrow, Page Down, SpaceGo to next slide (or step in Steps)
Option + PToggle Presenter Mode
Option + OToggle Overview Mode
Option + GToggle Grid Mode

CLI Options

-p --port     Dev server port
-h --host     Host the dev server listens to
--no-open     Prevent from opening in default browser

Videos & Articles

Examples

See how others have used MDX Deck for their presentations.

Usage Examples

The following examples will open in CodeSandbox.


Related

MIT License

NPM DownloadsLast 30 Days