Socket
Socket
Sign inDemoInstall

@mdx-js/tag

Package Overview
Dependencies
6
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mdx-js/tag

A fully-featured Markdown/MDX React component for ambitious projects


Version published
Maintainers
4
Install size
10.3 kB
Created

Readme

Source

@mdx-js/tag

Build Status lerna Join the community on Spectrum

Map components to HTML elements based on the Markdown syntax. Useful with MDX.

Installation

npm:

npm i -S @mdx-js/tag

Usage

import React from 'react'
import {renderToString} from 'react-dom/server'
import {MDXTag} from '@mdx/tag'

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

console.log(renderToString(<MDXTag name="h1" children="Hello, world!" />))
console.log(renderToString(<MDXTag name="h1" components={{h1: H1}} children="Hello, world!" />))

Yields:

<h1>Hello, world!</h1>
<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

Keywords

FAQs

Last updated on 06 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc