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 🙏

© 2026 – Pkg Stats / Ryan Hefner

upload-pulse

v1.0.0

Published

React file upload progress UI with drag-drop picker, themes, XHR hooks, and Tailwind CSS v4

Readme

upload-pulse

React 文件上传进度 UI 组件库:深色/浅色主题、拖拽投放、格式限制、多选与数量上限、XHR / Mock Hooks。

安装

npm install upload-pulse

Peer dependencies: reactreact-dom(>=18)

样式: 需配合 Tailwind CSS v4 使用。

快速开始

1. 引入样式

在应用入口 CSS 中:

@import 'tailwindcss';
@import 'upload-pulse/styles.css';

upload-pulse/styles.css 已包含组件所需的 Tailwind utility 与动画,一般无需再 @source 扫描包内 JS。

若你自行从源码集成组件(非 npm 包),需确保 Tailwind 能扫描到组件目录,例如:

@import 'tailwindcss';
@source "./node_modules/upload-pulse/dist/index.js";
@import 'upload-pulse/styles.css';

2. 使用组件

import { Upload, UploadPicker, UploadWithUpload } from 'upload-pulse';

function App() {
  return (
    <>
      <UploadPicker
        config={{
          accept: ['.xlsx', '.xls'],
          multiple: true,
          maxCount: 5,
          showButton: true,
          drag: { enabled: true, showDropzone: true },
        }}
        currentCount={0}
        onFilesSelected={(files) => console.log(files)}
      />

      <UploadWithUpload
        file={file}
        url="/api/upload"
        config={{ theme: 'dark', pausable: false }}
        onComplete={() => {}}
      />
    </>
  );
}

导出

| 组件 / Hook | 说明 | |-------------|------| | Upload | 受控进度卡片 | | UploadPicker | 选文件 + 拖拽 + 校验 | | UploadDropzone | 拖拽投放区 | | UploadWithUpload | XHR 上传封装 | | UploadWithMock | Mock 演示 | | useUpload | XHR Hook | | useUploadPicker | 选文件校验 | | useUploadDragDrop | 拖拽逻辑 | | useUploadDisplay | 进度展示计算 |

类型与常量:UploadConfigUploadPickerConfigDARK_THEME_COLORSLIGHT_THEME_COLORS 等。

本地开发

源码目录遵循 Ant Design 规范:src/components/upload/ 下按组件分子目录,interface.ts 定义类型,hooks/style/utils/ 分模块组织。

npm install
npm run dev

浏览器会打开预览页,可直接体验 UploadPickerUploadWithMock 的交互效果。修改 src/ 下组件源码会热更新。

构建组件库:

npm run build

预览生产构建:

npm run preview

发布

npm run build
npm publish --access public

在其他项目中链接本地包

{
  "dependencies": {
    "upload-pulse": "file:../UploadPulse"
  }
}

安装后执行 npm install,用法与 npm 包相同。

License

MIT