# vue-image-placeholder

> [![Build Status](https://travis-ci.org/astagi/vue-image-placeholder.svg?branch=master)](https://travis-ci.org/astagi/vue-image-placeholder) [![codecov](https://codecov.io/gh/astagi/vue-image-placeholder/branch/master/graph/badge.svg)](https://codecov.io/g

Latest version **0.1.1** (published 2020-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-image-placeholder
pnpm add vue-image-placeholder
yarn add vue-image-placeholder
bun add vue-image-placeholder
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-03-05 |
| First published | 2020-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 452.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | astagi |
| Maintainers | astagi |
| Keywords | Image, Placeholder, TypeSript, Vuejs |

## Links

- npm: https://www.npmjs.com/package/vue-image-placeholder
- Repository: https://github.com/astagi/vue-image-placeholder
- Issues: https://github.com/astagi/vue-image-placeholder/issues
- npm.io page: https://npm.io/package/vue-image-placeholder

## Dependencies (2)

- [vue-class-component](https://npm.io/package/vue-class-component.md) ^7.2.2
- [vue-property-decorator](https://npm.io/package/vue-property-decorator.md) ^8.3.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-03-05
- 0.1.0 — 2020-03-05

## README

# Vue Image Placeholder

[![npm-version](https://img.shields.io/npm/v/vue-image-placeholder.svg)](https://www.npmjs.com/package/vue-image-placeholder) [![Build Status](https://travis-ci.org/astagi/vue-image-placeholder.svg?branch=master)](https://travis-ci.org/astagi/vue-image-placeholder) [![codecov](https://codecov.io/gh/astagi/vue-image-placeholder/branch/master/graph/badge.svg)](https://codecov.io/gh/astagi/vue-image-placeholder) [![license](https://img.shields.io/npm/l/express.svg)]()

🌉 Multiservice Image Placeholder Vue component

## Installation

```sh
yarn add vue-image-placeholder
```

## Use it in your app

```ts
import ImagePlaceholder from 'vue-image-placeholder';
```

Render an image with `cats` from [LoremFlickr](https://loremflickr.com/) service

```html
<ImagePlaceholder width=500 height=250 images="cats" />
```

<img src="https://loremflickr.com/500/250/cats"/>

Image Placeholder component also supports [Placeholder.com](https://placeholder.com/) service, use `text` to show a label in the placeholder

```html
<ImagePlaceholder
  width=250 text="Hello Vue!"
  foreground="#34495e" background="#41B883"
/>
```

<img src="https://via.placeholder.com/250x250/41B883/34495e?text=Hello+Vue%21"/>


## Properties

`width` final image width (required)

`height` final image height (default is equal to width)

`images` category/categories for the image (if not specified the main service used is [https://placeholder.com/](https://placeholder.com/)):
  - `single value` returns an image of one category (e.g. 'cats').
  - `comma separated value` returns an image belonging to both categories (e.g. 'animals,cat').
  - `pipe separated value` returns an image belonging to one of the categories (e.g. 'animal|cats').
  - `'murray' `returns an image of Bill Murray from [Fill Murray](https://www.fillmurray.com/) service.
  - `'seagal'` return an image of Steve Seagal from [Steven Segallery](https://www.stevensegallery.com/) service.

The following properties are only for `Placeholder.com` service:

`text` text to show inside the image.

`background` background color for the placeholder (e.g. #000000).

`foreground` foreground color for the placeholder (e.g. #FFFFFF).

## Project setup for development

```sh
yarn install
```

### Compiles and minifies for production

```sh
yarn build
```

### Run unit tests

```sh
yarn test:unit
```

### Lints and fixes files

```sh
yarn lint
```

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