|
| 1 | +# [Status Indicator](https://github.com/coderdiaz/vue-status-indicator) · [](http://npmjs.com/package/vue-status-indicator) [](https://github.com/coderdiaz/vue-status-indicator/stargazers) [](https://travis-ci.org/coderdiaz/vue-status-indicator) [](https://npmjs.com/package/vue-status-indicator) |
| 2 | + |
| 3 | +A Vue component to show a status indicator as colored dots. This is a fork of [status-indicator](https://github.com/tnhu/status-indicator) with a few changes for use it with Vue. |
| 4 | + |
| 5 | +## Install/Usage |
| 6 | +<!-- Replace the docs for usage the plugin --> |
| 7 | +```sh |
| 8 | +# Install with npm |
| 9 | +$ npm i -S vue-status-indicator |
| 10 | + |
| 11 | +# or yarn |
| 12 | +$ yarn add vue-status-indicator |
| 13 | +``` |
| 14 | + |
| 15 | +```html |
| 16 | +<div id="app"> |
| 17 | + <status-indicator status="active" /> |
| 18 | +</div> |
| 19 | +``` |
| 20 | + |
| 21 | +You can use **Local Registration**: |
| 22 | +```js |
| 23 | +import { StatusIndicator } from 'vue-status-indicator'; |
| 24 | +new Vue({ |
| 25 | + el: '#app', |
| 26 | + components: { |
| 27 | + StatusIndicator, |
| 28 | + }, |
| 29 | +}); |
| 30 | +``` |
| 31 | + |
| 32 | +or **Global Registration**: |
| 33 | +```js |
| 34 | +import StatusIndicator from 'vue-status-indicator'; |
| 35 | +Vue.use(StatusIndicator); |
| 36 | + |
| 37 | +// or with a custom component name |
| 38 | +import { StatusIndicator } from 'vue-status-indicator'; |
| 39 | +Vue.component('custom-name', StatusIndicator); |
| 40 | +``` |
| 41 | + |
| 42 | +### Usage in browser |
| 43 | +<!-- Write an example for use the plugin in browser from CDN --> |
| 44 | +In browser you can use Unpkg, Jsdelivr, CDN.js, etc. |
| 45 | +```sh |
| 46 | +# Unpkg |
| 47 | +https://unpkg.com/vue-status-indicator@latest/dist/vue-status-indicator.js |
| 48 | + |
| 49 | +# JSDelivr |
| 50 | +https://cdn.jsdelivr.net/npm/vue-status-indicator@latest/dist/vue-status-indicator.min.js |
| 51 | +``` |
| 52 | + |
| 53 | +### Supported Browsers |
| 54 | +Latest versions of Chrome/Firefox/Safari/IE/Opera. |
| 55 | + |
| 56 | +## Documentation |
| 57 | +<!-- Add all documentation about the plugin: props, events, etc --> |
| 58 | +### Props |
| 59 | +|Name|Description|Type|Default|Required| |
| 60 | +|---|---|---|---|---| |
| 61 | +|status|Status color for the dot|String|""|false| |
| 62 | +|pulse|Enable or disable the pulse effect|Boolean|false|false| |
| 63 | + |
| 64 | +### Customatization |
| 65 | +You are able to customize the dot by CSS variables, default configuration is listed below. |
| 66 | + |
| 67 | +```css |
| 68 | +:root { |
| 69 | + --status-indicator-size: 10px; |
| 70 | + --status-indicator-animation-duration: 2s; |
| 71 | + |
| 72 | + --status-indicator-color: rgb(216, 226, 233); |
| 73 | + --status-indicator-color-semi: rgba(216, 226, 233, .5); |
| 74 | + --status-indicator-color-transparent: rgba(216, 226, 233, 0); |
| 75 | + |
| 76 | + --status-indicator-color-active: rgb(0, 149, 255); |
| 77 | + --status-indicator-color-active-semi: rgba(0, 149, 255, .5); |
| 78 | + --status-indicator-color-active-transparent: rgba(0, 149, 255, 0); |
| 79 | + |
| 80 | + --status-indicator-color-positive: rgb(75, 210, 143); |
| 81 | + --status-indicator-color-positive-semi: rgba(75, 210, 143, .5); |
| 82 | + --status-indicator-color-positive-transparent: rgba(75, 210, 143, 0); |
| 83 | + |
| 84 | + --status-indicator-color-intermediary: rgb(255, 170, 0); |
| 85 | + --status-indicator-color-intermediary-semi: rgba(255, 170, 0, .5); |
| 86 | + --status-indicator-color-intermediary-transparent: rgba(255, 170, 0, 0); |
| 87 | + |
| 88 | + --status-indicator-color-negative: rgb(255, 77, 77); |
| 89 | + --status-indicator-color-negative-semi: rgba(255, 77, 77, .5); |
| 90 | + --status-indicator-color-negative-transparent: rgba(255, 77, 77, 0); |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +## Community |
| 95 | +All feedback and suggestions are welcome! |
| 96 | + |
| 97 | +## License |
| 98 | +This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-status-indicator/master/LICENSE) |
0 commit comments