npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-loadover

v0.1.2

Published

vue-loadover is a collection of components for Vue.js that provide loading state inside your templates. Wrap any template node that should have a loading state in one of the vue-loadover components.

Downloads

2

Readme

vue-loadover

vue-loadover is a collection of components for Vue.js that provide loading state inside your templates. Wrap any template node that should have a loading state in one of the vue-loadover components.

Quick start

1. Install vue-loadover

npm install vue-loadover

2. Use in your templates

Display a full-size loading overlay on top of your component, controlled by the loading data prop.

<template>
  <load-over :loading="loading">
    <div>Hello World!</div>
  </load-over>
</template>

<script>
import { LoadOver } from 'vue-loadover';

export default {
  components: {
    LoadOver
  },
  data() {
    return { loading: true };
  },
  mounted() {
    // Display loading screen for 5 seconds
    setTimeout(() => (this.loading = false), 5000);
  }
};
</script>

See the examples for a deeper look on how to use LoadOver and other components.

Detailed documentation

Installation

vue-loadover is available as a public package from the npm registry. Install using your project's package manager.

npm install vue-loadover
# Or, using yarn
yarn add vue-loadover

Usage

vue-loadover components are designed to wrap the DOM nodes in your templates providing an easy mechanism to display a loading state on your components.

All vue-loadover components have a loading prop that can be set to control the state of the loading component.

Props

| Name | Type | Required | Default | | --------- | --------- | ------------------ | ------- | | loading | Boolean | :white_check_mark: | |

LoadOver

The LoadOver component displays a semi-transparent overlay with an animated spinner in the center when loading is true.

<template>
  <load-over :loading="loading">
    Hello World!
  </load-over>
</template>

LoadOver uses slots to overlay a white <div> on top of its children nodes. The animated spinner will scale with its content to a maximum size of 64x64 pixels.

:warning: The overlay is an absolutely positioned sibling of your content. Be careful when designing your layout.

LoadInto

The LoadInto component injects an animated spinner in the center of the its child node, displayed when loading is true.

<template>
  <main>
    <load-into :loading="loading">
      <span>Hello World!</span>
    </load-into>
  </main>
</template>

The spinner is inside an absolutely positioned <div> that is injected inside your component. When loading is true, LoadInto hides all other children and displays the spinner animation.

:warning: Because the spinner animation is injected directly inside your component, LoadInto must have a single (non-text) child node. Using a text node or more than one node will result in undefined behavior.

Contributing

If you are interested in contributing to vue-loadover feel free to fork the repository and submit a merge request into the dev branch.

Here are a few ideas of things that could be added:

TODO
  • Unit tests
  • Add a slot for custom loader
  • Add spinner SVG designs and animations (pure CSS loaders?)
  • Props to configure LoadOver overlay color and opacity
  • Props to configure SVG content color and opacity
  • Documentation website

License

vue-loadover is released under the Apache 2.0 License.

Copyright (c) 2020 Charles Francoise