Socket
Socket
Sign inDemoInstall

@mdx-js/react

Package Overview
Dependencies
Maintainers
4
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdx-js/react

React implementation for MDX


Version published
Weekly downloads
5.7M
decreased by-1.07%
Maintainers
4
Weekly downloads
 
Created

What is @mdx-js/react?

The @mdx-js/react package allows you to use MDX (Markdown for the component era) with React. MDX is a syntax that lets you seamlessly use JSX in your markdown documents. You can import components, such as interactive charts or alerts, and export metadata. This makes writing long-form content with React components a breeze.

What are @mdx-js/react's main functionalities?

Embedding JSX in Markdown

Allows embedding JSX directly in your markdown files, enabling the inclusion of React components within the content.

<MDXProvider><MyDocument /></MDXProvider>

Importing and using components in MDX

Enables the import and use of React components directly in MDX files, making it easy to integrate interactive or custom elements in markdown content.

import { Chart } from './components/Chart'

# My MDX document

Here's a chart component in my MDX document:

<Chart />

Using MDXProvider to customize components

Allows customization of standard markdown elements (like headings, paragraphs) with your own React components, providing a way to apply consistent styling or behavior across all markdown content.

import { MDXProvider } from '@mdx-js/react'
import { MyHeading, MyParagraph } from './MyComponents'

const components = {
  h1: MyHeading,
  p: MyParagraph
}

<MDXProvider components={components}>
  <MyDocument />
</MDXProvider>

Other packages similar to @mdx-js/react

Keywords

FAQs

Package last updated on 01 May 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc