|
1 | | -# vue-spinners-css |
| 1 | +# Vue Spinners CSS Loaders ([React](https://github.com/JoshK2/react-spinners-css), [Angular](https://github.com/JoshK2/ng-spinners)) |
| 2 | +[](https://bit.dev/joshk/vue-spinners-css) |
| 3 | +[](https://www.npmjs.com/package/vue-spinners-css) |
| 4 | +[](https://github.com/JoshK2/vue-spinners-css/stargazers) |
| 5 | +[](https://raw.githubusercontent.com/JoshK2/vue-spinners-css/master/LICENSE) |
| 6 | +[](https://twitter.com/JoshKuttler) |
| 7 | + |
| 8 | +Amazing collection of pure CSS vue spinners components of css spinners for ajax or loading animation based on loading.io. |
| 9 | +[Install components and live demo](https://bit.dev/joshk/vue-spinners-css) |
| 10 | +<p align="center"> |
| 11 | + <a href="https://bit.dev/joshk/vue-spinners-css"><img src="https://i.imagesup.co/images2/010e655fd10abc5621d067f8b8ad33c7cac7d840.gif"></a> |
| 12 | +</p> |
| 13 | + |
| 14 | +## 🚀 List of Spinners - PropTypes and Default Props |
| 15 | + |
| 16 | +Each component accepts a `color` prop, and `loading` prop. |
| 17 | +The default `color` prop is `#7f58af`. |
| 18 | +The default `loading` prop is `true`. |
| 19 | + |
| 20 | +| Spinner | color: string | loading: boolean | |
| 21 | +| ---------------- | ------------ | ------------- | |
| 22 | +| Circle Spinner | `#7f58af` | `true` | |
| 23 | +| Default Spinner | `#7f58af` | `true` | |
| 24 | +| DualRing Spinner | `#7f58af` | `true` | |
| 25 | +| Ellipsis Spinner | `#7f58af` | `true` | |
| 26 | +| Facebook Spinner | `#7f58af` | `true` | |
| 27 | +| Grid Spinner | `#7f58af` | `true` | |
| 28 | +| Heart Spinner | `#7f58af` | `true` | |
| 29 | +| Hourglass Spinner| `#7f58af` | `true` | |
| 30 | +| Ring Spinner | `#7f58af` | `true` | |
| 31 | +| Ripple Spinner | `#7f58af` | `true` | |
| 32 | +| Roller Spinner | `#7f58af` | `true` | |
| 33 | +| Spinner Spinner | `#7f58af` | `true` | |
| 34 | + |
| 35 | + |
| 36 | +## 📦 Installation |
| 37 | +### Using [npm](https://www.npmjs.com/package/vue-spinners-css) to install vue-spinners-css: |
| 38 | + |
| 39 | +```bash |
| 40 | +$ npm i --save vue-spinners-css |
| 41 | +``` |
| 42 | + |
| 43 | +### Play and install vue spinners with Bit |
| 44 | + |
| 45 | +Install specific vue spinner component with bit, npm or yarn without having to install the whole project. |
| 46 | +Using [bit](https://bit.dev/joshk/vue-spinners-css) to play with live demo, and try the spinners before install. |
| 47 | + |
| 48 | +set npm regisetry config(one time action): |
| 49 | +```bash |
| 50 | +npm config set '@bit:registry' https://node.bit.dev |
| 51 | +``` |
| 52 | +and use your favorite package manager: |
| 53 | +```bash |
| 54 | +npm i @bit/joshk.vue-spinners-css.facebook-loader |
| 55 | +yarn add @bit/joshk.vue-spinners-css.facebook-loader |
| 56 | +bit import joshk.vue-spinners-css/facebook-loader |
| 57 | +``` |
| 58 | + |
| 59 | +## 💻 Usage Examples |
| 60 | + |
| 61 | +you can use a random color from [jotils](https://bit.dev/joshk/jotils/get-random-color) |
| 62 | + |
| 63 | +### Vue Global Registration |
| 64 | +```javascript |
| 65 | +import Vue from 'vue' |
| 66 | +import * as VueSpinnersCss from "vue-spinners-css"; |
| 67 | + |
| 68 | +Vue.use(VueSpinnersCss) |
| 69 | + |
| 70 | +// Each spinner can now be used in your templates anywhere in the app! |
| 71 | +``` |
| 72 | + |
| 73 | +### Vue Local Registration |
| 74 | +```javascript |
| 75 | +<template> |
| 76 | + <FacebookLoader :color="randomcolor" /> |
| 77 | + <FacebookLoader /> |
| 78 | +</template> |
| 79 | + |
| 80 | +<script> |
| 81 | + //using npm or yarn |
| 82 | + import { FacebookLoader } from 'vue-spinners-css'; |
| 83 | + //using bit |
| 84 | + import FacebookLoader from '@bit/joshk.vue-spinners-css.facebook-loader'; |
| 85 | + import { getRandomColor } from '@bit/joshk.jotils.get-random-color' |
| 86 | + |
| 87 | + export default ( |
| 88 | + { |
| 89 | + data: () => ({ |
| 90 | + randomcolor: getRandomColor() |
| 91 | + }), |
| 92 | + components: { |
| 93 | + FacebookLoader, |
| 94 | + } |
| 95 | + } |
| 96 | + ) |
| 97 | +</script> |
| 98 | +``` |
| 99 | + |
| 100 | +### Unpkg Import |
| 101 | +```html |
| 102 | +<!--Load libraries in your page's header--> |
| 103 | +<script src="https://unpkg.com/vue"></script> |
| 104 | +<script src="https://unpkg.com/vue-spinners-css"></script> |
| 105 | + |
| 106 | +<!--Use a component somewhere in your app--> |
| 107 | +<div id="app"> |
| 108 | + <facebook-loader color="blue" /> |
| 109 | +</div> |
| 110 | + |
| 111 | +<script> |
| 112 | + new Vue({ el: '#app', data: { } }) |
| 113 | +</script> |
| 114 | +``` |
| 115 | + |
| 116 | + |
| 117 | +## 👾 Development |
| 118 | +You can see the components locally by cloning this repo and doing the following steps: |
| 119 | +- Install dependencies from `package.json`, run: `npm install`. |
| 120 | +- Run the app in the development mode, run: `npm run serve`. |
| 121 | + |
| 122 | +## ⌨️ Contributing |
| 123 | +- Pull requests and ⭐ stars are always welcome. |
| 124 | +- For bugs and feature requests, please create an issue. |
| 125 | + |
| 126 | +## 📄 License |
| 127 | +[MIT](https://github.com/JoshK2/vue-spinners-css/blob/master/LICENSE) |
2 | 128 |
|
3 | | -Under developement! |
|
0 commit comments