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

@mdx-js/runtime

Build Status lerna Chat

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

Props

The MDX Runtime component accepts two props:

Name Description
components Globally available components for the runtime
scope Variables that are accessible in the JSX portion of the document
remarkPlugins Array of remark plugins

Example code

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 />

<div>Here is the scope variable: {some}</div>
`

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.16-ci.0                                ...           ci (6 months ago)
  • 1.6.22                                ...           latest (2 months ago)
  • 2.0.0-next.8                                ...           next (4 months ago)

165 Versions

  • 1.6.22                                ...           2 months ago
  • 1.6.21                                ...           3 months ago
  • 1.6.20                                ...           3 months ago
  • 1.6.19                                ...           3 months ago
  • 2.0.0-next.8                                ...           4 months ago
  • 1.6.18                                ...           4 months ago
  • 1.6.17                                ...           4 months ago
  • 2.0.0-next.7                                ...           6 months ago
  • 1.6.16-ci.0                                ...           6 months ago
  • 1.6.16                                ...           6 months ago
  • 1.6.15                                ...           6 months ago
  • 2.0.0-next.6                                ...           6 months ago
  • 1.6.14                                ...           6 months ago
  • 2.0.0-next.4                                ...           6 months ago
  • 1.6.13-ci.1                                ...           6 months ago
  • 1.6.13                                ...           6 months ago
  • 1.6.12-ci.2                                ...           6 months ago
  • 1.6.12                                ...           6 months ago
  • 2.0.0-next.3                                ...           6 months ago
  • 1.6.11                                ...           6 months ago
  • 1.6.11-ci.0                                ...           6 months ago
  • 1.6.10-ci.0                                ...           6 months ago
  • 1.6.10                                ...           6 months ago
  • 1.6.9-ci.0                                ...           6 months ago
  • 1.6.9                                ...           6 months ago
  • 1.6.8                                ...           6 months ago
  • 1.6.8-ci.4                                ...           6 months ago
  • 1.6.7                                ...           6 months ago
  • 1.6.7-ci.4                                ...           6 months ago
  • 1.6.6                                ...           7 months ago
  • 1.6.5                                ...           8 months ago
  • 2.0.0-next.1                                ...           8 months ago
  • 1.6.4                                ...           8 months ago
  • 2.0.0-next.0                                ...           8 months ago
  • 1.6.3                                ...           8 months ago
  • 1.6.2                                ...           8 months ago
  • 1.6.2-ci.1                                ...           9 months ago
  • 1.6.1                                ...           9 months ago
  • 1.6.0                                ...           9 months ago
  • 1.5.9                                ...           9 months ago
  • 1.5.9-ci.5                                ...           9 months ago
  • 1.5.8                                ...           10 months ago
  • 1.5.8-ci.13                                ...           10 months ago
  • 1.5.8-alpha.0                                ...           a year ago
  • 1.5.7                                ...           a year ago
  • 1.5.7-alpha.0                                ...           a year ago
  • 1.5.6                                ...           a year ago
  • 1.5.6-alpha.0                                ...           a year ago
  • 1.5.6-ci.0                                ...           a year ago
  • 1.5.5                                ...           a year ago
  • 1.5.4                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.2                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.2-ci.2                                ...           a year ago
  • 1.1.1-ci.44                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.27-ci.0                                ...           2 years ago
  • 1.0.27                                ...           2 years ago
  • 1.0.26                                ...           2 years ago
  • 1.0.25                                ...           2 years ago
  • 1.0.24                                ...           2 years ago
  • 1.0.24-ci.5                                ...           2 years ago
  • 1.0.24-ci.3                                ...           2 years ago
  • 1.0.23                                ...           2 years ago
  • 1.0.22                                ...           2 years ago
  • 1.0.21                                ...           2 years ago
  • 1.0.20                                ...           2 years ago
  • 1.0.20-ci.2                                ...           2 years ago
  • 1.0.19-ci.5                                ...           2 years ago
  • 1.0.19                                ...           2 years ago
  • 1.0.18                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.16-ci.0                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.10                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5-ci.0                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.4-ci.0                                ...           2 years ago
  • 1.0.3-ci.2                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0-ci.0                                ...           2 years ago
  • 1.0.0-rc.4                                ...           2 years ago
  • 1.0.0-rc.3                                ...           2 years ago
  • 1.0.0-rc.2                                ...           2 years ago
  • 1.0.0-rc.0                                ...           2 years ago
  • 1.0.0-alpha.17                                ...           2 years ago
  • 1.0.0-alpha.16                                ...           2 years ago
  • 1.0.0-alpha.13                                ...           2 years ago
  • 1.0.0-alpha.11                                ...           2 years ago
  • 1.0.0-alpha.10                                ...           2 years ago
  • 1.0.0-alpha.9                                ...           2 years ago
  • 1.0.0-alpha.8                                ...           2 years ago
  • 1.0.0-alpha.7                                ...           2 years ago
  • 1.0.0-alpha.6                                ...           2 years ago
  • 1.0.0-alpha.5                                ...           2 years ago
  • 1.0.0-alpha.1                                ...           2 years ago
  • 0.20.3                                ...           2 years ago
  • 1.0.0-alpha.0                                ...           2 years ago
  • 0.20.2                                ...           2 years ago
  • 0.20.1                                ...           2 years ago
  • 0.20.0                                ...           2 years ago
  • 0.20.0-alpha.0                                ...           2 years ago
  • 0.19.0                                ...           2 years ago
  • 0.19.0-alpha.0                                ...           2 years ago
  • 0.18.2                                ...           2 years ago
  • 0.18.1                                ...           2 years ago
  • 0.18.0                                ...           2 years ago
  • 0.17.5                                ...           2 years ago
  • 0.17.4                                ...           2 years ago
  • 0.17.3                                ...           2 years ago
  • 0.17.0                                ...           2 years ago
  • 0.16.9                                ...           2 years ago
  • 0.16.8                                ...           2 years ago
  • 0.16.6                                ...           2 years ago
  • 0.16.5                                ...           2 years ago
  • 0.16.4                                ...           2 years ago
  • 0.16.3                                ...           2 years ago
  • 0.16.2                                ...           2 years ago
  • 0.16.1                                ...           2 years ago
  • 0.16.0                                ...           2 years ago
  • 0.15.7                                ...           2 years ago
  • 0.15.6                                ...           2 years ago
  • 0.15.5                                ...           2 years ago
  • 0.15.4                                ...           2 years ago
  • 0.15.3                                ...           2 years ago
  • 0.15.3-0                                ...           2 years ago
  • 0.15.2                                ...           2 years ago
  • 0.15.1                                ...           2 years ago
  • 0.15.0                                ...           2 years ago
  • 0.15.0-4                                ...           2 years ago
  • 0.15.0-3                                ...           2 years ago
  • 0.15.0-2                                ...           2 years ago
  • 0.15.0-1                                ...           2 years ago
  • 0.15.0-0                                ...           3 years ago
  • 0.14.1                                ...           3 years ago
  • 0.14.0                                ...           3 years ago
  • 0.13.1-1                                ...           3 years ago
  • 0.13.1-0                                ...           3 years ago
  • 0.13.0-0                                ...           3 years ago

Copyright 2014 - 2017 © taobao.org |