# @unpic/vue

> Vue component for responsive, high-performance images.

Latest version **1.0.0** (published 2025-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @unpic/vue
pnpm add @unpic/vue
yarn add @unpic/vue
bun add @unpic/vue
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2025-01-19 |
| First published | 2023-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2098 |
| Maintainers | ascorbic |
| Keywords | images, vue |

## Links

- npm: https://www.npmjs.com/package/@unpic/vue
- Repository: https://github.com/ascorbic/unpic-img
- Homepage: https://unpic.pics/img/vue
- Issues: https://github.com/ascorbic/unpic-img/issues
- npm.io page: https://npm.io/package/@unpic/vue

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^3.5.13
- [@unpic/core](https://npm.io/package/@unpic/core.md) ^1.0.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

- 1.0.0 (latest) — 2025-01-19
- 0.0.51 — 2024-12-07
- 0.0.50 — 2024-04-28
- 0.0.48 — 2024-02-19
- 0.0.47 — 2024-02-08
- 0.0.46 — 2024-02-07
- 0.0.45 — 2024-01-28
- 0.0.44 — 2024-01-27
- 0.0.43 — 2024-01-23
- 0.0.42 — 2024-01-06
- 0.0.41 — 2023-12-13
- 0.0.40 — 2023-12-05
- 0.0.39 — 2023-11-16
- 0.0.36 — 2023-11-13
- 0.0.35 — 2023-11-07
- … 34 more at https://npm.io/package/@unpic/vue/versions

## README

<div align="center">

![tree](https://unpic.pics/.netlify/images?url=tree.png&h=48)

# @unpic/vue

</div>

Vue component for responsive, high-performance images. Generates a responsive
`<img>` tag that follows best practices, with the correct srcset, sizes and
styles. Detects image URLs from most image CDNs and CMSs and can resize images
with no build step.

## Features

- Just an `<img>` tag! No extra elements, no runtime JavaScript. Easy to style.
- Automatically generates correct srcset and sizes attributes for responsive
  images
- Handles responsive resizing of images, preserving aspect ratio
- Uses native lazy loading and aync decoding for offscreen images
- Handles different image layouts: fixed, constrained and full width
- Uses eager loading and high priority fetching for important images
- Delivers modern image formats, including WebP and AVIF if supported by your
  browser
- No built step or server-side rendering required: uses your existing image CDN
  or CMS, with no additional configuration
- Uses [unpic](https://github.com/ascorbic/unpic) to support most image CDNs,
  including Cloudinary, Imgix, and Shopify
- Can generate a low-res background image for a blurred placeholder effect

## Installation and usage

```bash
npm install @unpic/vue
```

```vue
<script setup lang="ts">
import { Image } from "@unpic/vue";
</script>

<template>
  <Image
    src="https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg"
    layout="constrained"
    width="800"
    height="600"
    alt="A lovely bath"
  />
</template>
```

For the supported props, see [the docs](https://unpic.pics/img/vue).

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