@mdx-js/react
React implementation for MDX
Last updated 4 years ago by johno .
MIT · Repository · Bugs · Original npm
$ cnpm install @mdx-js/react 
SYNC missed versions from official npm registry.

@mdx-js/react

Build Status lerna Chat

Map components to HTML elements based on the Markdown syntax. Serves as the React implementation for MDX.

Installation

npm:

npm install --save @mdx-js/react

Usage

<!-- helloworld.md -->

# Hello, World!
import React from 'react'
import {MDXProvider} from '@mdx-js/react'
import {renderToString} from 'react-dom/server'

import HelloWorld from './helloworld.md'

const H1 = props => <h1 style={{color: 'tomato'}} {...props} />

console.log(
  renderToString(
    <MDXProvider components={{h1: H1}}>
      <HelloWorld />
    </MDXProvider>
  )
)

Yields:

<h1 style="color:tomato">Hello, world!</h1>

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

  • 2.0.0-ci.53                                ...           ci (4 years ago)
  • 2.3.0                                ...           latest (3 years ago)
  • 2.0.0-rc.2                                ...           next (4 years ago)

18 Versions

  • 2.3.0                                ...           3 years ago
  • 2.1.5                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 2.0.0-rc.2                                ...           4 years ago
  • 2.0.0-next.9                                ...           4 years ago
  • 2.0.0-ci.53                                ...           4 years ago
  • 1.6.22                                ...           5 years ago
  • 1.6.15                                ...           5 years ago
  • 2.0.0-next.7                                ...           5 years ago
  • 1.6.8-ci.4                                ...           5 years ago
  • 1.6.16                                ...           5 years ago
  • 2.0.0-next.1                                ...           5 years ago
  • 1.5.9-ci.5                                ...           5 years ago
  • 1.6.5                                ...           5 years ago
  • 1.0.20                                ...           6 years ago
  • 1.6.1                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org