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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-spinning-border

v1.0.5

Published

Dynamic, spinning image border animation for react.

Readme

React Spinning Border

react-spinning-border is a lightweight, customizable React component that creates a visually engaging, scroll-linked spinning border effect. Built with TypeScript, styled with TailwindCSS, and animated using Motion, it’s perfect for creating eye-catching avatar or profile image components.


Demo


Documentation

Explore the complete Storybook documentation for detailed usage, examples, and API reference:

View Storybook


Installation

Install the package via npm:

npm install react-spinning-border

SpinningBorder Component API

| Prop Name | Type | Default | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | image | string | Required | The local or external image source. Must be a valid image URL or path. Typically a profile or avatar image. | | colors | [HexColor] \| [HexColor, HexColor] \| [HexColor, HexColor, HexColor] \| [HexColor, HexColor, HexColor, HexColor] | ['#f137a6', '#fbe932', '#5c9eff', '#7ed21e'] | An optional array of hex color strings to customize border gradients. Must be 1 to 4 valid hex colors. | | size | 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full' | 'md' | The overall size of the component. Options: 'sm' (96x96px), 'md' (192x192px), 'lg' (320x320px), etc. | | border | 'sm' \| 'md' \| 'lg' \| 'xl' | 'md' | The size of the border around the image. Options: 'sm' (3%), 'md' (5%), 'lg' (7%), 'xl' (8%). | | padding | 'sm' \| 'md' \| 'lg' \| 'none' | 'md' | The size of the gap between the border and the image. Options: 'sm' (2%), 'md' (3%), 'lg' (7%), etc. | | speedFactor | number | 1 | A number used to speed up or slow down the spin animation. Recommended range: 0 to 10. | | className | string | undefined | Additional CSS classes for custom styling. | | ...rest | React.HTMLAttributes<HTMLDivElement> | undefined | Any additional HTML attributes to be passed to the component's container. |

Examples

Basic Usage

<SpinningBorder
  image="https://example.com/profile.jpg"
  size="lg"
  border="xl"
  colors={['#ff0000', '#00ff00', '#0000ff']}
/>

Custom Speed and Padding

<SpinningBorder
  image="/assets/avatar.png"
  size="md"
  border="lg"
  padding="sm"
  speedFactor={2}
  colors={['#e63946', '#f1faee']}
/>

Links

Author

This package was created and maintained by Seth Way.

License

This project is licensed under the MIT License.