All Projects → kyoncy → react-markdown-heading

kyoncy / react-markdown-heading

Licence: other
Render markdown table of contents as React component.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to react-markdown-heading

VOSviewer-Online
VOSviewer Online is a tool for network visualization. It is a web-based version of VOSviewer, a popular tool for constructing and visualizing bibliometric networks.
Stars: ✭ 44 (+144.44%)
Mutual labels:  react-component
react-drag-list
A simple draggable list component。
Stars: ✭ 30 (+66.67%)
Mutual labels:  react-component
react-material-datetimepicker
Material DateTime Picker для React.js
Stars: ✭ 12 (-33.33%)
Mutual labels:  react-component
react-simple-image-slider
simple image slider component for react
Stars: ✭ 127 (+605.56%)
Mutual labels:  react-component
react-parallax-card
[wip] React component for a 3D card with parallax effects similar to Apple TV app icons.
Stars: ✭ 21 (+16.67%)
Mutual labels:  react-component
react-credit-cards
Beautiful credit cards for your payment forms
Stars: ✭ 2,386 (+13155.56%)
Mutual labels:  react-component
react-mathjax-preview
The MathJax React component you were looking for.
Stars: ✭ 46 (+155.56%)
Mutual labels:  react-component
React-Limited-Infinite-Scroll
A limited infinite scroll component for React(React有限无限加载组件)
Stars: ✭ 37 (+105.56%)
Mutual labels:  react-component
react-table-filter
Create Filters on table column items(like Excel)
Stars: ✭ 54 (+200%)
Mutual labels:  react-component
react-crud-icons
57 SVG icons for CRUD applications, packaged as a React component with light & dark themes and tooltip.
Stars: ✭ 19 (+5.56%)
Mutual labels:  react-component
react-infinite-scroller
⏬ Infinite scroll component for React in ES6
Stars: ✭ 3,064 (+16922.22%)
Mutual labels:  react-component
esn
这是一个常用js小型工具库
Stars: ✭ 15 (-16.67%)
Mutual labels:  react-component
react-crossfade-image
react-crossfade-image - Simple React component for crossfading images - No CSS needed
Stars: ✭ 33 (+83.33%)
Mutual labels:  react-component
tocdown
A table of contents generator for markdown
Stars: ✭ 11 (-38.89%)
Mutual labels:  markdown-toc
histoslider
📊 A D3 based histogram slider component for React.
Stars: ✭ 31 (+72.22%)
Mutual labels:  react-component
tiny-ui
⚛️ A friendly UI component set for React.js
Stars: ✭ 202 (+1022.22%)
Mutual labels:  react-component
react-timepicker
React timepicker in Android KitKat style
Stars: ✭ 23 (+27.78%)
Mutual labels:  react-component
react-async-button
React button component for handling async actions
Stars: ✭ 31 (+72.22%)
Mutual labels:  react-component
animation-wrapper-view
Declarative animations with imperative controls for RN/RNW.
Stars: ✭ 53 (+194.44%)
Mutual labels:  react-component
fluent-windows
🌈 React components that inspired by Microsoft's Fluent Design System.
Stars: ✭ 122 (+577.78%)
Mutual labels:  react-component

react-markdown-heading

Render markdown table of contents as React component.

npm version install size minified size minzipped size codecov

Install

npm install react-markdown-heading

How to Use

import React from 'react'
import ReactDOM from 'react-dom'
import ReactMarkdownHeading from 'react-markdown-heading'

const markdown = '## h2\n### h3\n#### h4\n### h3\n# h1\n### h3'

render(
  <ReactMarkdownHeading
    markdown={markdown}
    hyperlink={true}
    onChangeHeading={(headingList) => {
      console.log(headingList)
    }}
    liClassName="li"
    activeAnchorClassName="activeAnchor"
  />,
  document.getElementById('root')
)

screen shot

Option

  • markdown - string, The Markdown source to parse (required)
  • ulClassName - string, Class name of the ul tag (optional)
  • liClassName - string, Class name of the li tag (optional)
  • anchorClassName - string, Class name of the anchor tag (optional)
  • hyperlink - boolean, Add hyperlink to text (default false)
  • blankSpaceReplaceText - string, Replace blank space in hyperlink to this (default -)
  • headingDepth - 1 | 2 | 3 | 4 | 5 | 6, Depth of heading to display (default 6)
  • hyperLinkPrefix - string, Hyperlink prefix (default empty)
  • onChangeHeading - (headingList: HeadingType[]) => void, Change event handler (optional)
  • activeHeading - HeadingType[], Designate active heading list (optional)
  • activeLiClassName - string, Class name of the active li tag (optional)
  • activeAnchorClassName - string, Class name of the active anchor tag (optional)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].