@lxdao/uploader3
TypeScript icon, indicating that this package has built-in type declarations

1.5.2 • Public • Published

Uploader3

npm version npm downloads

Uploader3 is a React-based Web3 image upload component that supports multiple image uploads, image cropping, and uploading images to Web3 Storage providers (like IPFS). There are two ways for uploading, by using a backend API or the Uploader3 Connector.

Features

  • Supports cropping
  • Supports uploading to web3 service providers, such as NFT.storage

Usage

import { Uploader3 } from '@lxdao/uploader3';

Props

Prop Type Description Default
accept string image accept file type ['.png','.jpeg','.jpg','.gif', '.svg']
multiple boolean multiple image upload false
api string endpoint upload api url, post method ''
headers object http headers to post api
connector object create by uploader3-connector
crop Crop / boolean crop config, set false disabled crop true
onChange function callback when files selected
onUpload function callback when file uploading
onComplete function callback when file uploaded
onCropEnd function callback when crop end
onCropCancel function callback when crop cancel

api and connector are mutually exclusive, if both are provided, api will be used. must be provided one of them.

Types reference

Crop

type Crop = {
  size: { width: number; height: number };
  aspectRatio: number;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @lxdao/uploader3

Weekly Downloads

26

Version

1.5.2

License

MIT

Unpacked Size

265 kB

Total Files

42

Last publish

Collaborators

  • sazzm
  • noyobo
  • jackysense
  • muxin_92
  • brucexu.eth