Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-loader-image

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-loader-image

Vue3 package for showing loader while image loading, with default skeleton

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Vue 3 Image Loader

Vue 3 package for showing a loader while an image loading with default using skeleton loader, see video below for demo.

https://github.com/ichsanputr/vue3-image-loader/assets/69036480/4296e70b-8780-41da-9d52-4ed765bfaef6

Usage

Installation

npm install vue-loader-image

Importing

This package support either composition and options api with typescript used.

<script lang="ts">
import VueLoaderImage from 'vue3-loader-image';
import 'vue3-loader-image/dist/style.css'
</script>

Or use option api.

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  components: {
      VueLoaderImage
  }
})
</script>

Example

We can use delay props to increase the time the image will be displayed, because sometimes the loader doesn't come out because the internet speed is good during the loading process.

<VueLoaderImage delay="4000" src="https://images.unsplash.com/photo-1439066615861-d1af74d74000?q=80&w=1973" width="300px" height="300px"></VueLoaderImage>

That's will be show image after image loaded plus 4 second.

Beside skeleton loader you also can use custom css loader like using slot like this.

<VueLoaderImage delay="4000" src="https://images.unsplash.com/photo-1439066615861-d1af74d74000?q=80&w=1973" width="300px" height="300px">
  <div class="loader"/>
</VueLoaderImage>

See more css loader on https://css-loaders.com/.

Props

AttributeTypeIs RequiredDescription
srcStringtrueImage source url which will be displayed
widthStringtrueWidth of image, accpeting all unit measured (1px, 1rem, 1%, etc)
heightStringtrueSame like width
delayStringnoImage will be show after loaded plus delay value
circleBooleannoBorder radius 100%
pillStringnoBorder radius custom value
altStringno--
crossoriginStringno--
loadingString, eager or lazyno--
longdescStringno--

Keywords

FAQs

Package last updated on 27 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc