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

v3-skeleton

v1.0.0

Published

`Vue3Skeleton` is a Vue 3 component designed to display a skeleton loading animation while content is being loaded. You can use it to improve the user experience while the main content or data is still loading.

Downloads

41

Readme

Vue3 Skeleton

Vue3Skeleton is a Vue 3 component designed to display a skeleton loading animation while content is being loaded. You can use it to improve the user experience while the main content or data is still loading.

Installation

First, install the package using npm or yarn:

npm install v3-skeleton

or

yarn add v3-skeleton

Basic Usage

Here’s an example of how to use the Vue3Skeleton component in your project:

<template>
  <Vue3Skeleton :loading="true" width="100%" height="20px">
    <template #default>
      <!-- Content to show when not loading -->
      <p>Loaded content</p>
    </template>
  </Vue3Skeleton>
</template>

<script setup>
import Vue3Skeleton from 'v3-skeleton';
</script>

See the a example project here.

Props

| Prop | Type | Default Value | Description | |-------------------|---------|-------------------|-----------------------------------------------------------------------------| | as | String | 'div' | The HTML tag used to wrap the skeleton. You can change it to any valid tag. | | loading | Boolean | false | If true, shows the skeleton, otherwise shows the slotted content. | | width | String | '100%' | The width of the skeleton. Any valid CSS width value is accepted. | | height | String | '20px' | The height of the skeleton. Any valid CSS height value is accepted. | | borderRadius | String | '4px' | The border-radius of the skeleton element. | | backgroundColor | String | '#e0e0e0' | The primary background color of the skeleton. | | toColor | String | '#f0f0f0' | The secondary color for the skeleton animation gradient. | | interval | String | '3s' | The animation duration for the skeleton. You can use any valid duration. |

Slots

  • default: The content to be displayed when loading is false.

Custom Styles

You can adjust the visual behavior of the skeleton via the props such as width, height, backgroundColor, borderRadius, etc.

Additionally, you can override the style in your own CSS file to fit the specific needs of your application:

.skeleton {
  width: 200px;
  height: 40px;
  background-color: #ccc;
  border-radius: 8px;
}

Animation

The animation is configurable using the interval prop, which adjusts the animation cycle duration. If you want to modify more aspects of the animation, you can do so via direct CSS styling.

Contribution

If you find any issues or would like to contribute to the project, feel free to open an issue or submit a pull request.


Thank you for using Vue3Skeleton!