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

particle-text

v1.1.2

Published

粒子特效文字组件

Readme

❗ 目前仅支持React

🌈 开箱即用

import Particle from "particle-text";

function App() {
  return (
    <div className="App">
      <Particle content="测试值" height={400} width={400} clickPlay />
    </div>
  );
}

🌻 支持配置项

interface PropsType {
  content: any; // 渲染内容
  physicsColor?: any; // 粒子颜色(目前仅支持rgba字符串格式,其它值会导致报错)
  physicsSize?: number; // 粒子尺寸
  height?: number; // 画布高度
  width?: number; // 画布宽度
  fontStyle?: Object; // 内容字体样式 (目前支持设置fontWeight,fontSize,fontFamily), 示例值 {fontSize: "4rem", fontWeight: 'bold',  fontFamily: 'Arial'}
  animationTime?: number; // 动画持续时间(毫秒)
  animationDelay?: number; // 动画延迟时间(毫秒)
  x?: number; // 内容展示在画布上的x坐标
  y?: number; // 内容展示在画布上的y坐标
  loop?: boolean; // 是否开启动画循环
  loopTime?: number; //动画循环间隔时间
  showContent?: boolean; // 动画结束是否显示原内容
  clickPlay?: boolean; // 通过点击播放动画
  defaultPlay?: boolean; // 默认播放动画,默认为true
  hoverPlay?: boolean; // 鼠标滑过播放动画
  animationDoneCallBack?: Function; // 动画完成后回调
  animationStartCallBack?: Function; // 动画开始回调
}

❓FAQ

问:为什么首次渲染和后续通过事件触发的渲染效果不一样?

答:react在生成环境中如果有使用strict标签包裹子元素,那么这些子元素的useEffect会触发两次,若在其中某个子元素中引用了该组件,也会导致初始化进行两次。部署到生产环境就正常了,不用过多关心。