A React library to help developers add files upload feature to web3 world - IPFS/Filecoin easily.
yarn add web3-uploader
import Web3Uploader from 'web3-uploader'
<Web3Uploader
apiToken="WEB3.STORAGE-TOKEN"
onUploaded={handleUploaded}
onLoading={handleLoading}
/>
-
apiToken
The web3.storage token, follow up the steps of #Get an API token to get a web3.storage API token. -
onUploaded
The callback once all files uploaded to IPFS/Filecoin -
onLoading
The loading status -
accept
Set accepted file types. One of type: string, string[] -
maxFiles
Maximum accepted number of files The default value is 0 which means there is no limitation to how many files are accepted. -
disabled
Enable/disable the dropzone. -
canUpload
Whether the web3 uploader can upload the files to IPFS/Filecoin.