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​

import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@fazio/ipfs-upload-button';

@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
selector: 'app-root',
template: `
<div>
<web3-upload-btn
token="{{token}}"
isdisplayresult="true"
isdisplaytoast="true"></web3-upload-btn>
</div>
`
})
export class AppComponent {
token = 'WEB3STORAGE_APIKEY'
}

Preview result​

Upload to IPFS