Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/moimikey/react-footnotes

👣 dead simple footnotes, in React
https://github.com/moimikey/react-footnotes

footnote footnotes react react-components

Last synced: about 2 months ago
JSON representation

👣 dead simple footnotes, in React

Awesome Lists containing this project

README

        

# 👣 react-footnotes

dead simple footnotes, in React

react-footnotes

## Installation

```sh
npm install --save react-footnotes
yarn add react-footnotes
```

```js
// esmodules
import { Footnotes } from 'react-footnotes'

// commonjs
var Footnotes = require('react-footnotes').Footnotes
```

## Usage

Pass any props you want to read from `getFootnotes`, to `Footnote`.

```jsx
import * as React from 'react'
import { Footnotes } from 'react-footnotes'

class App extends React.Component {
render() {
return (

{({ Footnote, getFootnotes }) => (

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Text that doesnt need to be footnoted, can be passed as normal text.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


    {Object.keys(getFootnotes()).map(i => {
    return (
  1. {getFootnotes()[i].desc}

  2. )
    })}


)}

)
}
}
```

## TODO

- [ ] automatically generate the index number so it doesn't have to be passed manually...

## Development

```sh
npm run dev

# go to http://localhost:1234
```

### Distribution

```sh
npm run build
```