# react-loadsvg

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

Latest version **1.0.5** (published 2023-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-loadsvg
pnpm add react-loadsvg
yarn add react-loadsvg
bun add react-loadsvg
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-10-01 |
| First published | 2023-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ShivamDevs |
| Maintainers | shivamdewangan |
| Keywords | react, react-loading, loading-icon, svg-loader, svg-icon, load, loading, load-icon |

## Links

- npm: https://www.npmjs.com/package/react-loadsvg
- Repository: https://github.com/shivamdevs/npm-packages.git#main
- Homepage: https://github.com/shivamdevs/npm-packages/tree/main/react-loadsvg#readme
- Issues: https://github.com/shivamdevs/npm-packages/issues
- npm.io page: https://npm.io/package/react-loadsvg

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.6.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2023-10-01
- 1.0.4 — 2023-10-01
- 1.0.3 — 2023-09-01
- 1.0.2 — 2023-09-01
- 1.0.0 — 2023-03-25

## 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`.

```bash
npm install react-loadsvg
```

or

```bash
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:

```jsx
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

```jsx
<LoadSVG size={30} color="red" />
```

Example 2: Disabling the background stroke

```jsx
<LoadSVG backStroke={0} />
```

Example 3: Changing the line cap style

```jsx
<LoadSVG lineCap="square" />
```

Example 4: Customizing the animation duration

```jsx
<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`.

```css
.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](https://github.com/shivamdevs/npm-packages/tree/main/react-loadsvg).

## License

The `react-loadsvg` package is licensed under the [MIT License](https://github.com/shivamdevs/npm-packages/tree/main/react-loadsvg/LICENSE).

---
_Source: https://npm.io/package/react-loadsvg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
