A module boilerplate for react component.

Usage no npm install needed!

<script type="module">
  import 36nodeUpload from 'https://cdn.skypack.dev/@36node/upload';



version downloads

a upload component that upload file to aliyun, support crop before upload and can integrate with antd form


yarn add @36node/upload antd ali-oss



import Upload from "@36node/upload";
import "@36node/upload/dist/index.css";

const ossOptions = {
  endpoint: '<oss endpoint>',
  credentials: {
    accessKeyId: '<Your accessKeyId>',
    secretAccessKey: '<Your secretAccessKey>',
  region: '<oss region>',
  bucket: '<Your bucket name>',
  url: '<oss prefix>'

<Upload ossOptions={ossOptions}>

Integrate With Form

    {getFieldDecorator("upload", {
      initialValue: [
          uid: Date.now(),
          status: "done",
          name: "logo",
          url: "./images/logo.png",
      <Upload ossOptions={ossOptions}>

Crop Before Upload

check all crop options here

const cropOptions = {
  crop: {
    unit: "%",
    width: 100,
    aspect: 1,

<Upload ossOptions={ossOptions} cropOptions={cropOptions}>

check full examples here


@36node/upload is base on antd upload, it supports all antd upload api, check it here

some extra options are list below

Property Description Type Default
ossOptions aws-client-s3 options, required object -
cropOptions crop option from react-image-crop object -
maxFileSize the max size of file list. Size unit is kb. number -
maxFileNumber the max number of file list number -
value initial file list array -
onChange A callback function, can be executed when uploading state is changing Function -
listType Built-in stylesheets, support for three types: text, picture or picture-card String 'text'
accept File types that can be accepted. See input accept Attribute String -
preview Preview the uploaded pictures. If preview is true, the upload component will display preview of picture. Boolean true


  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D


module © 36node, Released under the MIT License.

Authored and maintained by 36node with help from contributors (list).

github.com/zzswang · GitHub @36node