npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@appvitalinc/file-upload-widget-api-react

v1.0.2

Published

React wrapper library to quickly integrate Appvital File picker & cloud uploader in your application with just few lines of code.

Downloads

14

Readme

Core Features

  • Drag & Drop or Copy & Paste any file
  • Pick files from multiple sources including popular online file shares
  • Upload files straight to your own Amazon S3, Azure Bob & SFTP storages
  • Crop, rotate, flip and enhance photos to perfection with built-in photo editor
  • Generate thumbnails, apply text or image watermarks
  • Complete control with configurable options and much more

Demo/Examples

See file upload widget in action here with example configurations demonstrating various features.

Quick Start

Install it through NPM

npm install @appvitalinc/file-upload-widget-api-react
import { ApvFilePicker } from '@appvitalinc/file-upload-widget-api-react';

const MyComponent = () => {
  return (
    <ApvFilePicker
      apikey={'apiKey'}
    />
  )
}

Available inputs

| Name | Type | Required | Default | Description | | ------- | -------------------- | -------- | ------- | ------------------------------------------------------------------- | | apikey | String | True | | Filepicker api key | | options | ApvFilePickerOptions | | | Check ApvFilePickerOptions |

Callbacks

| Name | Function | Required | Default | Description | | --------------- | --------------------- | -------- | ------- | -------------------------------------- | | onOpen | () | | | Fires when filepicker has been initialized and is ready. |
| onClose | () | | | Fires when filepicker popup is closed. | | onCancel | () | | | Fires when filepicker is canceled. | | onUploadStarted | () | | | Fires when file(s) uploading starts. | | onUploadDone | (ApvFilePickerResponse) | | | Fires when uploading completes. | | onUploadError | (error) | | | Fires when file(s) upload is failed. |

Below you can find some quick basic implementations.

Open picker - Single file upload

import { ApvFilePicker } from '@appvitalinc/file-upload-widget-api-react';

const MyComponent = () => {

  const apikey = 'YOUR_API_KEY';
  const options =  {
      multiple: false,
      outputfileoptions: {
        width: 500,
        height: 281,
        resizetype: "fit",
        resizeconflict: "pad",
        storage: [
          {
            name: "AWS-S3-Storage-Demo",
            path: "/file-picker-demo/",
          },
        ],
      },
      inputfileoptions: {
        allowedfileformats: "jpg,jpeg,gif,bmp,png,webp,zip,pdf",
        maxfilesize: 700000000,
        note:
          "File size restricted to: 10000 KB / File type restricted to: JPG, PNG, JPEG, PDF, DOC, DOCX, TXT, XML and ZIP.",
      },
    };
  };

  onOpen = () =>  {
    console.log('Modal open');
  }

  onClose = () => {
    console.log('Modal Close');
  }

  onCancel = () => {
    console.log('On Cancel');
  }

  onUploadDone = (data) => {
      console.log('onUploadStart', data);
  }

  onUploadStart = () => {
    console.log('onUploadStart');
  }

  onUploadError = (data) => {
    console.log('onUploadError', data);
  }

  return (
    <ApvFilePicker
      apiKey={apikey}
      options={options}
      onOpen={onOpen}
      onClose={onClose}
      onCancel={onCancel}
      onUploadDone={onUploadDone}
      onUploadStarted={onUploadStart}
      onUploadError={onUploadError} 
      />
    );
}

Documentation

You can find further documentation about available filepicker options and configuration details here at https://appvital.com/docs/file-uploader#Quickstart-React

Contributing

Any of your contributions or ideas are more than welcome. Please consider that we follow the conventional commits specification to ensure consistent commit messages and changelog formatting.