Skip to main content

Attributes usage

Component have a lot of attributes, but not all of them are required. This page will help you to understand which attributes are required and which are optional.

Attributes

You can use the following attribut to toggle the component behavior:

  • token - required - Your IPFS provider APIKEY or JWT (see Configuration).
  • provider - optional - IPFS provider. Possible values: pinata, web3.storage (default: web3.storage).
  • isdisplayresult - optional - Display the result of the upload in the DOM. Default value is false.
  • isdisplaytoast - optional - Display notification toast. Default value is false.
  • isfromurl - optional - Upload file from URL. Default value is false.

Code example

export function App() {
const token = 'WEB3STORAGE_APIKEY';

return (
<>
<div/>
<web3-upload-btn
token={token}
isdisplayresult={true}
isdisplaytoast={true}></web3-upload-btn>
<div />
</>
);
}
export default App;

Preview result

Upload to IPFS