react-download-link
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

react-download-link

A simple component to download data from a client-side cache (e.g. flux, redux).

Design to be used with browserify or webpack.

Install with:

npm install --save react-download-link

Include with:

import DownloadLink from "react-download-link";

Use:

<DownloadLink
    label="Save"
    filename="myfile.txt"
    exportFile={() => "My cached data"}
/>

Or with Promises:

<DownloadLink
    label="Promise to Save"
    filename="myfile.txt"
    exportFile={() => Promise.resolve("My cached data")}
/>

The component will default to an anchor tag, but the tagName prop will accept a string of any other HTML tag you prefer, such as 'button'.

Package Sidebar

Install

npm i react-download-link

Weekly Downloads

2,372

Version

2.3.0

License

MIT

Unpacked Size

7.78 kB

Total Files

6

Last publish

Collaborators

  • e_khalili_s
  • petermoresi