# vue-environment-sticker

> Vue.js component which shows a sticker displaying current environment name (e.g. 'demo', 'stg')

Latest version **0.2.1** (published 2020-06-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install vue-environment-sticker
pnpm add vue-environment-sticker
yarn add vue-environment-sticker
bun add vue-environment-sticker
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2020-06-07 |
| First published | 2020-06-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 269.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | doyaaaaaken |
| Maintainers | doyaaaaaken |
| Keywords | Vue.js, component |

## Links

- npm: https://www.npmjs.com/package/vue-environment-sticker
- Repository: https://github.com/doyaaaaaken/vue-environment-sticker
- Issues: https://github.com/doyaaaaaken/vue-environment-sticker/issues
- npm.io page: https://npm.io/package/vue-environment-sticker

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Recent versions

- 0.2.1 (latest) — 2020-06-07
- 0.2.0 — 2020-06-07
- 0.1.7 — 2020-06-07
- 0.1.6 — 2020-06-07
- 0.1.5 — 2020-06-07
- 0.1.4 — 2020-06-07
- 0.1.3 — 2020-06-07
- 0.1.2 — 2020-06-07
- 0.1.1 — 2020-06-02
- 0.1.0 — 2020-06-02

## README

<h1 align="center">Welcome to vue-environment-sticker 👋</h1>
<p>
  <a href="https://www.npmjs.com/package/vue-environment-sticker" target="_blank">
    <img alt="Version" src="https://img.shields.io/npm/v/vue-environment-sticker.svg">
  </a>
  <a href="#" target="_blank">
    <img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
  </a>
</p>

> Vue.js component which shows a sticker displaying current environment name (e.g. 'demo', 'stg')

You can make it easier to understand which environments you are accessing (staging? demo? production?) and **reduce incidents.**

### ✨ Demo

[CodePen](https://codepen.io/doyaaaaaken/pen/NWxqyYz)

![Image of Demo page](pictures/default-theme.png)

**ℹ️ Theare are only few themes available. I'll waiting your pull requests for the new COOL themes. See [HOW_TO_DEVELOP.md](HOW_TO_DEVELOP.md) if you're interested in it.**

# Usage

## with Yarn / npm

Install it.

```bash
yarn add vue-environment-sticker

# or if you use npm
# `npm install vue-environment-sticker`
```

Then, import and register the component.

```javascript
import Vue from "vue";
import EnvironmentSticker from "vue-environment-sticker";

Vue.component("environment-sticker", EnvironmentSticker);
```

The component itself does not include any CSS. You'll need to include it separately:

```javascript
import 'vue-environment-sticker/dist/vue-environment-sticker.css';
```

Alternatively, you can import the scss for complete control of the component styles:
```scss
@import "vue-environment-sticker/dist/vue-environment-sticker.css";
```


That's all!! You can use `environment-sticker` component like below.
```sh
<body>
  <div class="content-wrapper>
   <h1>Demo page</h1>
  </div>
  
  <EnvironmentSticker
      label="STAGING"
      theme="SQUARE"
  />
</body>
``` 

These are available props. (**all props are optional.**)

| name | type | default value | description                         |
|------------|---------------|---------------|-------------------------------------|
| label | String | `DEMO` | label which shows environment name |
| position | String | `BOTTOM_RIGHT` | sticker position. <br/><br/>Available values: `BOTTOM_RIGHT` / `BOTTOM_LEFT` |
| theme | String | `SQUARE` | The appearance of the label. <br/><br/>Available values: `SQUARE`<br/><br/> **ℹ️ Theare are only few themes available. I'll waiting your pull requests for the new COOL themes. See [HOW_TO_DEVELOP.md](HOW_TO_DEVELOP.md) if you're interested in it.** |
| containerStyles | Object | `{}` | CSS styles for the container. This is bound as [inline style](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles). <br/><br/>e.g. `{padding: '4px'}` |
| labelStyles | Object | `{}` | CSS styles for the label. This is bound as [inline style](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles). <br/><br/>e.g. `{fontSize: '12px', color: 'blue'}` |


## via CDN (directly install in the browser)

you can install it directly in the browser through CDN.

```html
<!-- include VueJS first -->
<!--<script src="https://unpkg.com/vue@latest"></script>-->

<!-- use the latest vue-environment-sticker release -->
<script src="https://unpkg.com/vue-environment-sticker@latest"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-environment-sticker@latest/dist/vue-environment-sticker.css">

<!-- or point to a specific vue-environment-sticker release -->
<script src="https://unpkg.com/vue-environment-sticker@0.2.0"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-environment-sticker@0.2.0/dist/vue-environment-sticker.css">
```

That's all!! You can use `environment-sticker` component.  
See detail on `with Yarn / npm Section`.

## Show your support

Give a ⭐️ if this project helped you!

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

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