react-footnotes

0.1.2 • Public • Published

👣 react-footnotes

dead simple footnotes, in React

Installation

npm install --save react-footnotes
yarn add react-footnotes
// esmodules
import { Footnotes } from 'react-footnotes'
 
// commonjs
var Footnotes = require('react-footnotes').Footnotes

Usage

import * as React from 'react'
import * as Footnotes from 'react-footnotes'
 
class App extends React.Component {
  render() {
    return (
      <Footnotes>
        {({ Footnote, getFootnotes }) => (
          <React.Fragment >
            <Footnote i={1} source={`https://google.com`} desc={`this is a description.`}>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Footnote>
            <Footnote i={2} source={`https://google.com`} desc={`this is a description.`}>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</Footnote>
            <Footnote i={3} source={`https://google.com`} desc={`this is a description.`}>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</Footnote>
            <Footnote i={4} source={`https://google.com`} desc={`this is a description.`}>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</Footnote>
            {JSON.stringify(getFootnotes())}
          </React.Fragment>
        )}
      </Footnotes>
    )
  }
}

Development

npm run dev
 
# go to http://localhost:1234 

Distribution

npm run build

Package Sidebar

Install

npm i react-footnotes

Weekly Downloads

2

Version

0.1.2

License

WTFPL

Unpacked Size

33.7 kB

Total Files

12

Last publish

Collaborators

  • moimikey