# vue-button-spinner

> A simple button spinner.

Latest version **2.2.1** (published 2018-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-button-spinner
pnpm add vue-button-spinner
yarn add vue-button-spinner
bun add vue-button-spinner
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2018-10-10 |
| First published | 2016-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 35 |
| Author | jnieto |
| Maintainers | jnieto |
| Keywords | events, loader |

## Links

- npm: https://www.npmjs.com/package/vue-button-spinner
- Repository: https://github.com/wanxe/vue-button-spinner
- Homepage: https://github.com/wanxe/vue-button-spinner#readme
- Issues: https://github.com/wanxe/vue-button-spinner/issues
- npm.io page: https://npm.io/package/vue-button-spinner

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.2

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.2.1 (latest) — 2018-10-10
- 2.2.0 — 2017-11-04
- 2.1.0 — 2017-10-24
- 2.0.0 — 2017-08-17
- 1.2.0 — 2016-12-06
- 1.1.3 — 2016-11-14
- 1.1.2 — 2016-11-14
- 1.1.1 — 2016-11-14
- 1.0.2 — 2016-11-14
- 1.0.0 — 2016-11-14

## README

# VueButtonSpinner
[![npm version](https://badge.fury.io/js/vue-button-spinner.svg)](https://badge.fury.io/js/vue-button-spinner)

> Simple VUE 2 component to create a button spinner. The perfect solution for your submit buttons!

![alt tag](https://ibin.co/31v55OGl4kwc.gif)

# Features

- Show an css loader into the button to indicate the request status.
- Add a custom html inside the component.
- Pure CSS loaders, no fonts or images have been used.
- Different styles for each state: loading, success, error.
- Available props:
    * 'isLoading' (boolean) to show the spinner
    * 'status' (String | Boolean) allow 'success' or true and 'error' or false.
- **Remember use the .native modifier for the events ([docs](https://vuejs.org/v2/guide/migration.html#Listening-for-Native-Events-on-Components-with-v-on-changed))**

# Install

```npm install vue-button-spinner```

# Usage

### Example:

[Your .vue component (vue-loader with webpack or use vue-cli projects)]
```js

import VueButtonSpinner from 'vue-button-spinner';

export default {
		name: 'events-form',
		data() {
			return {
				isLoading: false,
				status: '',
			}
		},
		components: {	
			VueButtonSpinner
		},
		methods: {
			onSubmit() {
			    this.isLoading = true
				$someRequest('/url', 'GET')
				.then(response => {
					this.isLoading = false
					this.status = true // or success
					setTimeout(() => { this.status = '' }, 2000) // to clear the status :)
				})
				.catch(error => {
					console.error(error)
					this.isLoading = false
					this.status = false //or error
				})
			}
		}
}

```

[Your HTML code]
```html

<button-spinner
	:is-loading="isLoading" 
	:disabled="isLoading"
	:status="status">
	<span>Submit</span>
</button-spinner>

```

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