All Projects → cheersmas → React Upload Box

cheersmas / React Upload Box

Licence: mit
A minimal Upload component for React.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Upload Box

Linearprogressbar
Material Linear Progress Bar for your iOS apps
Stars: ✭ 131 (-22.49%)
Mutual labels:  progress-bar
Next Nprogress
Next.js HOC to integrate NProgress inside your app
Stars: ✭ 145 (-14.2%)
Mutual labels:  progress-bar
Gif Progress
🎬 Attach progress bar to animated GIF
Stars: ✭ 156 (-7.69%)
Mutual labels:  progress-bar
Upload
The file upload extension with insane intelligence for your Flarum forum.
Stars: ✭ 131 (-22.49%)
Mutual labels:  upload
Fgdownloader
用于断点下载、任务队列、上传进度、下载进度
Stars: ✭ 143 (-15.38%)
Mutual labels:  upload
Progresshud
ProgressHUD is a lightweight and easy-to-use HUD for iOS.
Stars: ✭ 2,045 (+1110.06%)
Mutual labels:  progress-bar
Cos Wx Upload File
微信小程序上传文件到腾讯云v5;Wechat mini program upload file to tencent cos v5
Stars: ✭ 129 (-23.67%)
Mutual labels:  upload
Ax5ui Kernel
Javascript UI Framework - AX5UI - Kernel Module
Stars: ✭ 164 (-2.96%)
Mutual labels:  upload
Youtube
Upload a video to a single YouTube channel with Laravel 5.
Stars: ✭ 143 (-15.38%)
Mutual labels:  upload
Progress Bar.sh
Simple & sexy progress bar for `bash`, give it a duration and it will do the rest.
Stars: ✭ 155 (-8.28%)
Mutual labels:  progress-bar
Cloudinary ios
Cloudinary iOS SDK
Stars: ✭ 133 (-21.3%)
Mutual labels:  upload
Bilibiliupload
Upload video to bilibili under command-line interface
Stars: ✭ 141 (-16.57%)
Mutual labels:  upload
Ffpb
A progress bar for ffmpeg. Yay !
Stars: ✭ 149 (-11.83%)
Mutual labels:  progress-bar
Filestack React
Official React component for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 131 (-22.49%)
Mutual labels:  upload
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-7.69%)
Mutual labels:  upload
Progressbar
A really basic thread-safe progress bar for Golang applications
Stars: ✭ 2,212 (+1208.88%)
Mutual labels:  progress-bar
Vue Wait
Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
Stars: ✭ 1,869 (+1005.92%)
Mutual labels:  progress-bar
Ascii Progress
🍓 Ascii progress-bar(s) in the terminal.
Stars: ✭ 167 (-1.18%)
Mutual labels:  progress-bar
Multer Gridfs Storage
🍃 GridFS storage engine for Multer to store uploaded files directly to MongoDb
Stars: ✭ 162 (-4.14%)
Mutual labels:  upload
D2 Crud Plus
面向配置的crud框架,基于d2-admin的d2-crud,简化d2-crud配置,快速开发crud功能;支持远程数据字典,国际手机号校验,alioss、腾讯云cos、七牛云文件上传、头像裁剪,省市区选择,权限管理,代码生成
Stars: ✭ 154 (-8.88%)
Mutual labels:  upload

React Upload Box

Description

Table of Contents

Installation

  yarn add react-upload-box

Getting Started

The box covers 100% of the parent div. Make sure to wrap it in a component with a flexible width. Otherwise, it "wobbles" as percentage changes.

  import React, { useState } from 'react'
  import { ReactUpload } from 'react-upload-box'
  function App() {
    const [percentage, setPercentage] = useState(0)
    const [pause, setPause] = useState(false)
    const uploadFile = async () => {
      ...
      setPercentage(newPercentage)
    }
    const handlePause = async () => {
      ...
      setPause(true)
    }
    const handleStart = async () => {
        ...
        setPause(false)
    }
    return (
      <div className="App">
        <ReactUpload
          mode="light"
          theme={customTheme} //overrides mode
          fileName={meta.fileName}
          percentage={percentage}
          paused={pause}
          disabled={percentage === 100}
          completed={percentage === 100}
          onPause={handlePause}
          onStart={handleStart}
        />
      </div>
    )
  }
  export default App

Props

name type description required default
fileName string file name of the uploading file true undefined
paused boolean current pause state of the uploading file true undefined (falsy)
percentage number percentage of file uploaded true undefined
completed boolean prop to signal if upload completed (used to apply themes on complete) false false
disabled boolean prop to disable play/pause button (usually after upload finishes) false false
mode light or dark light or dark theme mode (is overriden if theme is also supplied) false 'light' (allowed values: 'light' or 'dark')
onPause () => void callback fired onClick of Pause Button press false false
onStart () => void callback fired onClick of Play Button press false false
strokeHeight number or string height of the line from base line false 25%
strokeWidth number width of the line false 2
theme DefaultTheme custom theme for the component false check Default Theme Types

Default Theme Types

box, overlayColor, line, icons share the same keys to control colors during different stages:

running: 'color when upload is running',
paused: 'color when upload is paused',
completed: 'color when upload is completed',
disabled?: '(applicable to only icon) color when upload is disabled'
key description
box controls color of the container box's background
overlayColor controls color of overlay's background
line controls color of curvy line's stroke
text controls color of percentage & fileName texts
icons controls color of icons

Refer this configuration for more details:

lightTheme: DefaultTheme = {
  box: {
    completed: '#b7dabe',
    paused: '#f5f5f5',
    running: '#f1f8f2',
  },
  overlayColor: {
    completed: '#d5f5da'
    paused: '#e6e6e6',
    running: '#d5f5da',
  },
  line: {
    completed: '#b5e2bc'
    paused: '#00171F',
    running: '#b5e2bc',
  },
  text: {
    fileName: '#00171F',
    percentage: '#00171F'
  },
  icons: {
    completed: 'gray',
    disabled: 'gray',
    paused: '#00171f',
    running: '#00171f'
  }
};

To create one's own theme copy paste these values and change them accordingly. All keys must be present otherwise the properties are set to none;

Mentions and References

Icons

Code and configuration mentions

Meta

Distributed under the MIT license. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].