From 5d85401e6c9c61f6c0380deef26ee621a93891aa Mon Sep 17 00:00:00 2001
From: Anastasia Kataeva
- Website • - Quick Start • - Docs • + Website • + Docs • Blog • Discord • Twitter
-# 📦 Uploadcare File Uploader: stack-agnostic library for uploading, processing, and editing images on-the-fly +# Uploadcare File Uploader [![npm version](https://badge.fury.io/js/@uploadcare%2Ffile-uploader.svg)](https://www.npmjs.com/package/@uploadcare/file-uploader) [![GitHub Actions](https://github.com/uploadcare/blocks/workflows/checks/badge.svg)](https://github.com/uploadcare/blocks/actions?query=workflow%3ABuild+branch%3Amaster) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) +[![minzipped size](https://img.shields.io/bundlephobia/minzip/@uploadcare/file-uploader@latest)](https://bundlephobia.com/package/@uploadcare/file-uploader@latest) -_Uploadcare File Uploader_ is a powerful JavaScript library for creating custom file-handling services. -It includes various interactive and customizable UI components to enhance users' file uploading -and processing experience. As a bonus, you receive all the -[Uploadcare's](https://uploadcare.com/?ref=github-readme) versatile file-handling capabilities, -including [smart CDN](https://uploadcare.com/docs/delivery/cdn/#content-delivery-network/?ref=github-readme), -[MIME-type filtering](https://uploadcare.com/docs/moderation/#file-types/?ref=github-readme), -[signed uploads](https://uploadcare.com/docs/security/secure-uploads/?ref=github-readme), -and [even more](<(https://uploadcare.com/features/?ref=github-readme)>). +Add file uploads to your app and configure behavior and appearance as needed. Process and transform files before and after uploading. Compatible with any framework or environment. -See Uploadcare File Uploader [in action](https://codesandbox.io/p/devbox/github/uploadcare/blocks-examples/tree/main/examples/js-uploader)! + - +## Features -## Core features +- **Multiple upload sources:** Drop files, select from the filesystem, use a link, camera, Dropbox, Google Drive, add them via the upload API, and more. +- **Large file handling:** Upload faster with chunking, retries, and resumable uploads. +- **Customizable appearance:** Use pre-built themes or modify styles with CSS to fit your project. +- **Responsive and cross-browser:** Fits any device; supports the latest desktop and mobile versions of Chrome, Edge, Firefox, Opera, and Safari. +- **Fully accessible:** A11Y options, including keyboard navigation, screen reader support, and color contrast settings. +- **Advanced image editing:** Optimize images and apply smart transformations like cropping, resizing, or color filters via the built-in image editor, REST, or URL API. +- **Secure uploads:** Protect your app by automatically detecting inappropriate content, malicious files, or unauthorized uploads. +- **Typescript support:** Full Typescript support with autocompletion, type checking, and more for a better developer experience. -- [File Uploader](https://uploadcare.com/docs/file-uploader/?ref=github-readme) — implement file-managing functionality with minimal or comprehensive interfaces in just a few minutes. - -- [Adaptive Images](https://uploadcare.com/docs/adaptive-image/?ref=github-readme) — build responsive user interfaces that adapt to various screen sizes and devices, ensuring a performant experience across platforms. -- [Cloud Image Editor](https://uploadcare.com/docs/file-uploader/image-editor/?ref=github-readme) — edit, transform, and process images right from a browser on-the-fly. -- [Uploadcare power and features](https://uploadcare.com/features/?ref=github-readme) — upload, process, deliver, and manage images without building custom infrastructure. - -* **Coming soon!** Web Components for any media content management like audio, video, image galleries, and more. - -## Why Uploadcare File Uploader? - -### Rapid integration - -We provide a ready-to-use set of UI components for file handling. It saves you valuable development time and effort, allowing you to focus on other core aspects of your application. You even don't need to build a stage while developing — just run the code directly from the browser. - -### Cross-platform compatibility +## Framework support -Uploadcare File Uploader are designed to work seamlessly across various platforms and frameworks. Whether you're building a web application using React, Vue.js, Angular, Svelte, or other frameworks, you get [integrations and support](https://uploadcare.com/docs/integrations/?ref=github-readme) for various development environments. +Uploadcare File Uploader is built with [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), meaning you can integrate it into any environment—no adapters required. -### Developer-friendly +For hands-on examples, visit our live sandboxes: -The library comes with modern technologies at your fingertips, like [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), [ESM-level](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) code sharing, and other cutting-edge web standards. _Uploadcare File Uploader_ is designed lightweight with minimum external dependencies for a cheap security audit. +- [React](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/react-uploader) +- [Next.js](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/next-uploader) +- [JavaScript](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/js-uploader) +- [Angular](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/angular-uploader) +- [Vue](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/vue-uploader) +- [Svelte](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/svelte-uploader) -### Typescript support +Check out the [documentation](https://uploadcare.com/docs/integrations/?ref=github-readme) for quickstart guides tailored to your framework or tool. -We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html) and type definitions ([\*.d.ts files](https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html)) for TypeScript static analysis support during development. +Explore more tutorials in our [blog](https://uploadcare.com/blog/category/uploading/?ref=github-readme). -## 🚀 Getting started +## Quick Start ### From CDN -1. Connect Uploadcare File Uploader directly from your document: +1. Connect File Uploader directly from your document: ```html ``` -2. Start using Uploadcare File Uploader in your application markup: +2. Add File Uploader in your application markup: ```html ``` -3. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration). +3. Configure File Uploader and add your personal public key to the project. [Learn more](#configuration). ### From NPM -1. Install Uploadcare File Uploader package: `npm i @uploadcare/file-uploader` -2. Connect `Blocks` from your script file: +1. Install the package: `npm i @uploadcare/file-uploader` +2. Connect File Uploader from your script file: ```js import * as UC from '@uploadcare/file-uploader'; @@ -101,7 +92,7 @@ import * as UC from '@uploadcare/file-uploader'; UC.defineComponents(UC); ``` -3. Start using Uploadcare File Uploader in your application markup: +3. Add File Uploader in your application markup: ```html ``` -4. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration). +4. Configure File Uploader and add your personal public key to the project. [Learn more](#configuration). ### Configuration -All configurations in Uploadcare File Uploader are managed from `uc-config` block. +All configurations in File Uploader are managed from `uc-config` block. 1. Sign up to [Uploadcare](https://app.uploadcare.com/accounts/signup/?ref=github-readme). 2. Get a Public API key in [Uploadcare project's dashboard](https://app.uploadcare.com/projects/-/api-keys/?ref=github-readme). @@ -126,13 +117,9 @@ All configurations in Uploadcare File Uploader are managed from `uc-config` bloc