Skip to content

Vue ​

Optimized image component for Vue.

Install ​

sh
$ npm add @urami/vue
$ npm add @urami/vue
sh
$ pnpm add @urami/vue
$ pnpm add @urami/vue
sh
$ yarn add @urami/vue
$ yarn add @urami/vue
sh
$ bun add @urami/vue
$ bun add @urami/vue

Usage ​

vue
<script>
import Image from "@urami/vue";
</script>

<template>
  <Image
    src="https://httpmemes.netlify.app/200.jpg"
    width="801"
    height="801"
    alt="Tom Scott"
    class="rounded-xl shadow-md"
  />
</template>
<script>
import Image from "@urami/vue";
</script>

<template>
  <Image
    src="https://httpmemes.netlify.app/200.jpg"
    width="801"
    height="801"
    alt="Tom Scott"
    class="rounded-xl shadow-md"
  />
</template>

Props ​

NameTypeDefaultRequiredDescription
srcstring-✅Source of the image
widthnumber-✅Width of the image
heightnumber-❌Height of the image (Specify this will results in less layout shift)
qualitynumber75❌Quality of the image
loaderfndefaultLoader❌Loader function, please refer to Loader
formatsstring[]['webp', 'jpg']❌Formats to generate for the <picture> element