npm

Get private packages and team management tools with npm Orgs.Learn more »

react-download-link

2.2.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
    filename="myfile.txt"
    exportFile={() => "My cached data"}
>
        Save to disk
</DownloadLink>

Or with Promises:

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

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'.

install

npm i react-download-link

Downloadsweekly downloads

607

version

2.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability