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

vue3-ui-preloader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-ui-preloader

Vue3 preloader component made with CSS transistions and animations, easy to use, integrate and customize.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
36
decreased by-46.27%
Maintainers
1
Weekly downloads
 
Created
Source

logo

Codacy Badge Netlify Status Language License NPM Package NPM Downloads

NPM

Remake made from: Vue-ui-preloader.

Main changes

  • Added support for Vue 3.
  • Fixed the issue where the "overflowHidden" class remained active after the first use.
  • Added options to add text to the loaders and customize them.

Demo and playground

Live demo - https://vue3-ui-preloader.netlify.app/

Playground Website. Adjust the settings using the playground options. On the bottom of the page you will find the source code that you can directly use in your project or you can manually change the props.

npm link - https://www.npmjs.com/package/vue3-ui-preloader

Vue 3 blitz link - https://stackblitz.com/edit/vue-xxhtha?file=src%2FApp.vue

Installation

# use yarn
yarn add vue-ui-preloader
# use npm
npm install --save vue3-ui-preloader

Usage

Vue 3 blitz link - https://stackblitz.com/edit/vue-xxhtha?file=src%2FApp.vue

In your main.js

import { createApp } from 'vue'
import App from './App.vue'
import loader from "vue3-ui-preloader";

// Import the CSS or use your own!
import "vue3-ui-preloader/dist/loader.css"

const app = createApp(App)

app.component('loader', loader)

app.mount('#app')

In your template

<template>
	<loader  name="spinning" loadingText="Loading..." textColor="#ffffff" textSize="20" textWeight="500" object="#ff9633" color1="#ffffff" color2="#17fd3d" size="5" speed="2" bg="#343a40" objectbg="#999793" opacity="80" :disableScrolling="true"></loader>
</template>

NOTE: The best way to control the loader is to have a flag and use it in a v-if or v-show statement.
You can either use the playground website to automatically get all the props set or you can set them manaully using the below prop list. You can also resort to not passing any prop, in this case the preloader will use default settings.

Via CDN

CDN demo link - https://jsfiddle.net/1t0jyeqh/10/

In your index.html

<script src="https://unpkg.com/vue3-ui-preloader"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vue3-ui-preloader/dist/loader.css">

In your template

<div id="app">
	<loader  name="spinning" loadingText="Loading..." textColor="#ffffff" textSize="20" textWeight="500" object="#ff9633" color1="#ffffff" color2="#17fd3d" size="5" speed="2" bg="#343a40" objectbg="#999793" opacity="80" :disableScrolling="true"></loader>
</div>

In your main.js

const { createApp } = Vue

const app = createApp(loader)

app.mount('#app')

Props

NameTypeDefaultDescription
namestring'spinning'decides the type of loader
objectstring'#ff9633'set the color of the loaders. hex or color
loadingTextstring'Loading...'set the text of some loaders.
textColorstring'#ffffff'set the color of the loadingText. hex or color
textSizenumber'15'set the size of the loadingText.
textWeightnumber/string'800'set the weight of the loadingText. (Ex: 800, bold)
color1stringonly for circularset the color of the circular loader disk1. hex or color
color2stringonly for circularset the color of the circular loader disk2. hex or color
sizenumber5set the size of loader
bgstring'#343a40'set the color of the loader background. hex or color
objectbgstring'#999793'set the color of the loader object background. hex or color
opacitynumber80set the opacity of background
speednumber2animation speed in seconds
disableScrollingbooleanfalsedisable page scrolling when preloader is open

Author

© Gonçalo Bastos

Keywords

FAQs

Package last updated on 25 Oct 2023

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