1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-29 13:58:02 +03:00
♠️ React MDX-based presentation decks
Go to file
2018-07-29 11:12:33 -04:00
docs Add default components 2018-07-29 11:12:33 -04:00
lib Add default components 2018-07-29 11:12:33 -04:00
src Add default components 2018-07-29 11:12:33 -04:00
.babelrc Setup for package 2018-07-28 19:02:19 -04:00
.gitignore Add build 2018-07-28 21:39:45 -04:00
.npmignore Add build 2018-07-28 21:39:45 -04:00
cli.js Add default components 2018-07-29 11:12:33 -04:00
loader.js Setup for package 2018-07-28 19:02:19 -04:00
package.json Add build 2018-07-28 21:39:45 -04:00
README.md Add default components 2018-07-29 11:12:33 -04:00

mdx-deck

Create presentation decks with MDX

npm i mdx-deck
# This is the title of my deck
---
# About Me
---
```jsx
<CodeSnippet />
```
---
import Demo from './components/Demo'

<Demo />
---
# The end
mdx-deck deck.mdx

Usage

Create an MDX file and separate each slide with ---. MDX can use Markdown syntax and render React components with JSX.

Imports

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

import { Box } from 'grid-styled'

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

Theming

A custom theme can be provided by exporting theme from the MDX file.

export { default as theme } from './theme'

# Hello

The theme should be an object based on styled-system's theme schema.

// example theme.js
export default {
  font: 'Menlo, monospace',
  fontSizes: [
    16, 24, 32, 48, 64, 96, 128
  ],
  colors: {
    text: '#f0f',
    background: '#000',
    link: '#0ff'
  },
  css: {
    // apply any styles to the root element
  }
}

Custom Components

mdx-deck includes default components for MDX, but to provide custom components to the MDXProvider, export a components object from your MDX file.

export { default as components } from './components'

# Custom Components

Layouts

Each slide can include a custom layout around its content.

import Layout from './Layout'

# No Layout

---
export default Layout

# Custom Layout

Exporting

TK


  • default styles
  • URL hash
  • Root provider
  • export build