Negligent Parachute Maintainers

npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

@mdx-js/react

1.0.16 • Public • Published

@mdx-js/react

Build Status lerna Join the community on Spectrum

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

/* @jsx mdx */
import React from 'react'
import {renderToString} from 'react-dom/server'
import {MDXProvider, mdx} from '@mdx-js/react'
 
const H1 = props => <h1 style={{color: 'tomato'}} {...props} />
 
console.log(
  renderToString(
    <MDXProvider components={{ h1: H1 }}>
      <h1>Hello, world!</h1>
    </MDXProvider>
  )
)

Yields:

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

Contribute

See contributing.md in mdx-js/mdx for ways to get started.

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

License

MIT © Compositor and ZEIT

install

npm i @mdx-js/react

Downloadsweekly downloads

26,778

version

1.0.16

license

MIT

homepage

mdxjs.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability