Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

♠️ React MDX-based presentation decks

License

NotificationsYou must be signed in to change notification settings

jxnblk/mdx-deck

Repository files navigation

MDX Deck

Award-winning ReactMDX-based presentation decks

Build StatusVersionDownloads

View demo

Getting Started

npm i -D mdx-deck

Create anMDX file and separate each slide with---.

#Hello---##This is my deck---##The End

Add a run script to yourpackage.json with the MDX Deck CLIpointing 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'<Boxcolor="tomato">Hello</Box>

Read more about MDX syntax in theMDX Docs.

Theming

MDX Deck usesTheme UI andEmotion 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,aNotes component for adding speaker notes,aHead component for the document head,Header andFooter components for persistent header and footer content,and aSteps component for adding multiple intermediate steps in a single slide.

Read more in theComponents docs.

Third-Party Components

These optional libraries are intended for use with MDX Deck.

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 atemplate for visually differentiating slides.

// example Layout.jsimportReactfrom'react'exportdefault({ children})=>(<divstyle={{width:'100vw',height:'100vh',backgroundColor:'tomato',}}>{children}</div>)
importLayoutfrom'./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 stylesor style child elements with CSS-in-JS.

Presenter Mode

PressOption + P to togglePresenter 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 inSteps)
Right Arrow, Page Down, SpaceGo to next slide (or step inSteps)
Option + PTogglePresenter 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


[8]ページ先頭

©2009-2025 Movatter.jp