0.1.2 • Published 6 years ago

react-footnotes v0.1.2

Weekly downloads
3
License
WTFPL
Repository
github
Last release
6 years ago

👣 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