@mdx-js/runtime
Parse and render MDX in a runtime environment
Last updated 5 years ago by johno .
MIT · Repository · Bugs · Original npm
$ cnpm install @mdx-js/runtime 
SYNC missed versions from official npm registry.

@mdx-js/runtime

Build Status lerna Join the community on Spectrum

Parse and render MDX in a runtime environment.

:warning: warning: this is not the preferred way to use MDX since it introduces a substantial amount of overhead and dramatically increases bundle sizes. It should also not be used with user input that isn’t sandboxed.

Installation

npm:

npm i -S @mdx-js/runtime

Usage

import React from 'react'
import MDX from '@mdx-js/runtime'

// Provide custom components for markdown elements
const components = {
  h1: props => <h1 style={{color: 'tomato'}} {...props} />,
  Demo: props => <h1>This is a demo component</h1>
}

// Provide variables that might be referenced by JSX
const scope = {
  some: 'value'
}

const mdx = `
# Hello, world!

<Demo />
`

export default () => (
  <MDX components={components} scope={scope}>
    {mdx}
  </MDX>
)

Contribute

See the Support and Contributing guidelines on the MDX website for ways to (get) help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and Vercel

Current Tags

  • 1.6.2-ci.1                                ...           ci (5 years ago)
  • 1.6.5                                ...           latest (5 years ago)
  • 2.0.0-next.1                                ...           next (5 years ago)

6 Versions

  • 1.6.22                                ...           5 years ago
  • 2.0.0-ci.53                                ...           4 years ago
  • 2.0.0-next.9                                ...           4 years ago
  • 2.0.0-next.1                                ...           5 years ago
  • 1.6.2-ci.1                                ...           5 years ago
  • 1.6.5                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org