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-loadsvg

v1.0.5

Published

The LoadSVG component is a simple and customizable SVG-based loading spinner.

Downloads

15

Readme

LoadSVG

The LoadSVG component is a simple and customizable SVG-based loading spinner. It can be easily integrated into any React application and customized according to the needs of the user.

Installation

To use react-loadsvg in your project, you need to install it first using npm or yarn.

npm install react-loadsvg

or

yarn add react-loadsvg

Usage

Once you have installed the react-loadsvg package, you can use the LoadSVG component in your React application. Here's an example of how to use it:

import LoadSVG from 'react-loadsvg';

function App() {
  return (
    <div>
      <LoadSVG size={50} color="blue" />
    </div>
  );
}

In the example above, the LoadSVG component is imported from the react-loadsvg package and rendered inside a div element. The size and color props are passed to the component to customize its appearance.

Props

The LoadSVG component accepts the following props:

| Prop | Type | Default | Description | | ---- | ---- | ------- | ----------- | | size | number | 20 | Specifies the size of the spinner in pixels. | | stroke | number | 8 | Specifies the width of the spinner stroke in pixels. | | backStroke | number | 0 | Specifies the width of the background stroke in pixels. Set to 0 to disable. | | duration | number | 2000 | Specifies the duration of the spinner animation in milliseconds. | | lineCap | string | "round" | Specifies the line cap style of the spinner stroke. Accepts "butt", "round", or "square". | | color | string | "dodgerblue" | Specifies the color of the spinner stroke. | | backColor | string | "transparent" | Specifies the color of the background stroke. |

Examples

Here are some examples of how to use the LoadSVG component with different props:

Example 1: Changing the size and color

<LoadSVG size={30} color="red" />

Example 2: Disabling the background stroke

<LoadSVG backStroke={0} />

Example 3: Changing the line cap style

<LoadSVG lineCap="square" />

Example 4: Customizing the animation duration

<LoadSVG duration={4000} />

Styling

The LoadSVG component can be styled using CSS, just like any other React component. The class name of the SVG element is loadSVG.

.loadSVG {
  /* CSS styles here */
}

Contributing

Contributions to the react-loadsvg package are welcome and encouraged! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request on the GitHub repository.

License

The react-loadsvg package is licensed under the MIT License.