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

rc-carrousel

v1.0.5

Published

react 旋转木马图片轮播组件

Readme

rc-carrousel —— 一款 React 旋转木马图片轮播组件

想写个应用发现没找到react旋转木马这种类型的轮播图组件,于是就自己写了一个;

应用,一款萌萌哒星座运势chrome插件

(https://github.com/FourPig/constellation)

[email protected]

开始使用

安装

npm i rc-carrousel -S

或者

yarn add rc-carrousel -S

使用:

  import React from 'react';
  import Carrousel from 'rc-carrousel';

  const App=()=>{
    // 图片路径
    const imgPath = './static';
    // 图片数组,包含title 和 src 属性,按顺序渲染
    const imageArr = [
      { title:'shuangzi', src:`${ imgPath }/shuangzi.png` },
      { title:'baiyang', src:`${ imgPath }/baiyang.png` },
      { title:'chunv', src:`${ imgPath }/chunv.png` },
      { title:'jingniu', src:`${ imgPath }/jingniu.png` },

      { title:'juxie', src:`${ imgPath }/juxie.png` },
      { title:'mojie', src:`${ imgPath }/mojie.png` },
      { title:'sheshou', src:`${ imgPath }/sheshou.png` },
      { title:'shizi', src:`${ imgPath }/shizi.png` },

      { title:'shuangyu', src:`${ imgPath }/shuangyu.png` },
      { title:'shuiping', src:`${ imgPath }/shuiping.png` },
      { title:'tianping', src:`${ imgPath }/tianping.png` },
      { title:'tianxie', src:`${ imgPath }/tianxie.png` },

    ];

    return(
      <Carrousel 
        width={ 750 } 
        perSideWidth={ 150 }
        perSideNum={ 3 }
        scale={ 0.8 }
        align="bottom"
        imageArr={ imageArr }
      />
    )
  }

配置参数

| 属性 | 说明 | 默认 | | --- | --- | --- | | width | Number 组件宽度 | 600 | | perSideWidth | Number 两侧按钮宽度 | 150 | | perSideNum | Number 两侧显示图片数 | 2 | | scale | Number 两侧图片缩放比 | 0.8 | | gradient | Boolean 两侧图片透明度渐变 | false | | align | String 两侧图片位置 'top' || 'center' || 'bottom' | false | | autoPlay | Boolean 是否开启自动轮播 | false | | autoDirect | Boolean 自动轮播方向 | right | | autoPlayDelay | Boolean 自动轮播时间间隔 | 2 | | imageArr | Array 图片数组[{title:'',src:''}] | null | | --- | --- | --- | | onNextClick | Function 点击向右 回调 | (img)=>{console.log(img);//返回中间图片信息对象} | | onPreClick | Function 点击向左 回调 | (img)=>{console.log(img);//返回中间图片信息对象} | | onChange | Function 图片切换 回调 | (img)=>{console.log(img);//返回中间图片信息对象} |