Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lacymorrow/react-github-readme-md

Render the README.md file of a GitHub Repository in React
https://github.com/lacymorrow/react-github-readme-md

component github github-readme markdown md npm react reactjs readme

Last synced: 2 days ago
JSON representation

Render the README.md file of a GitHub Repository in React

Awesome Lists containing this project

README

        

# react-github-readme-md [](https://www.patreon.com/bePatron?u=55065733)
[![npm version](https://badge.fury.io/js/react-github-readme-md.svg)](https://badge.fury.io/js/react-github-readme-md) [![Maintainability](https://api.codeclimate.com/v1/badges/182efedf2a8b7f1ac89c/maintainability)](https://codeclimate.com/github/lacymorrow/react-github-readme-md/maintainability)

> Render the README.md file of a GitHub Repository in React

[**Storybook Demo**](https://www.chromatic.com/component?appId=6528a9ef83709c394594fc93&csfId=lacymorrow-react-github-readme-md&buildNumber=5&k=6528ae3054fd2afdd25fb253-1200px-interactive-true&h=3&b=-1)

## Features
* Render any Markdown file with GitHub styling
* Supports both `light` and `dark` modes
* Marked plugins add support for fuzzy links, heading anchors, and [GFM alerts](https://github.com/orgs/community/discussions/16925)
* Works on both the client and server

> [!IMPORTANT]
> GFM alerts work too!

## Install

Using [NPM](https://npmjs.com):

```bash
$ npm install react-github-readme-md
```

## Usage
```js
import { GitHubReadme } from "react-github-readme-md";

// ...

// or
// Heading and anchor links work.

_optional_
Type: `boolean`
default: `true`

#### `props.linkify`

Uses `marked-linkify-it` to parse fuzzy links in the markdown like google.com and turn them into links.

_optional_
Type: `boolean`
default: `false`

## Plugins

### Fuzzy Links

See the [marked-linkify-it](https://www.npmjs.com/package/marked-linkify-it) package for more information.

### Heading Anchors

See the [marked-gfm-heading-id](https://www.npmjs.com/package/marked-gfm-heading-id) package for more information.

### GFM Alerts

You may need Tailwind CSS installed for the alerts to display correctly.
See the [marked-alerts](https://github.com/bent10/marked-extensions/tree/main/packages/alerts) package for more information.

## Credit

Thanks to [Sindresorhus](https://github.com/sindresorhus) for his [`generate-github-markdown-css`](https://github.com/sindresorhus/generate-github-markdown-css) repo, used to generate the styles!

##### Also
- [marked](https://github.com/markedjs/marked)
- [marked-gfm-heading-id](https://www.npmjs.com/package/marked-gfm-heading-id)
- [marked-linkify-it](https://www.npmjs.com/package/marked-linkify-it)

## License
[MIT](http://opensource.org/licenses/MIT) © [Lacy Morrow](http://lacymorrow.com)