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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-widget-spinner

v1.0.0

Published

react-widget-spinner

Downloads

6

Readme

react-widget-spinner

安装

npm install --save react-widget-spinner

使用

Edit react-widget-spinner

import Spinner from 'react-widget-spinner';
import 'react-widget-spinner/style';

<Spinner />;

Interfaces

declare const sizeMap: {
    small: number;
    default: number;
    medium: number;
    large: number;
};
export interface SpinnerProps extends React.HTMLAttributes<any> {
    /** 样式前缀 */
    prefixCls?: string;
    /** 组件大小 */
    size?: keyof typeof sizeMap | number;
    /** TODO: 延迟显示加载效果的时间 ms */
    delay?: number;
    /** 圈圈周长:0-1 */
    value?: number;
    /** 风格,默认:primary */
    type?: "none" | "primary" | "success" | "warning" | "danger";
    /** 边框大小 */
    strokeWidth?: number;
    /** 是否为加载中状态 */
    spinning?: boolean;
    tagName?: React.ElementType;
}
export declare const Spinner: React.FC<SpinnerProps>;
export default Spinner;

defaultProps

{
	prefixCls: "rw-spinner",
	size: "default",
	type: "primary",
	spinning: true,
	tagName: "div",
	value: 0.25,
}

基础样式

@keyframes rw-spinner-animation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rw-spinner {
    display: none;
    align-items: center;
    justify-content: center;

    overflow: visible;
    vertical-align: middle;

    transition: color 500ms linear;
}

.rw-spinner-spinning {
    display: inline-flex;
}

.rw-spinner-primary {
    color: #1890ff;
}
.rw-spinner-success {
    color: #52c41a;
}
.rw-spinner-warning {
    color: #faad14;
}
.rw-spinner-danger {
    color: #ff4d4f;
}

.rw-spinner svg {
    display: block;
}

.rw-spinner path {
    fill-opacity: 0;
}

.rw-spinner-head {
    transform-origin: center;
    transition: stroke-dashoffset 200ms cubic-bezier(0.4, 1, 0.75, 0.9);
    stroke-linecap: round;
}

.rw-spinner-track {
    stroke: rgba(92, 112, 128, 0.2);
}

.rw-spinner .rw-spinner-animation {
    animation: rw-spinner-animation 500ms linear infinite;
}