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

rt-skeleton

v18.0.1

Published

Angular component for skeleton loading

Downloads

58

Readme

RT_SKELETON

  • Version 1.1.0 - Add rtSkeletonPlaceholderContainer directive
  • Version 1.1.1 - Fix export rtSkeletonPlaceholderContainer directive
  • Version 1.1.2 - Edit readme
  • Version 1.1.3 - Changed removing elements on display none
  • Version 1.1.4 - Change display block on flex for rtSkeletonPlaceholderContainer
  • Version 1.2.0 - Add rightSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.0 - Changed rightSkeleton option on marginSkeleton for rtSkeletonPlaceholder directive
  • Version 1.3.1 - Fix bug with marginSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.2 - Fix bug with marginSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.3 - Fix bug with marginSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.4 - Fix bug with marginSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.5 - Fix bug with marginSkeleton option for rtSkeletonPlaceholder directive
  • Version 1.3.6 - Optimization for rtSkeletonPlaceholder directive
  • Version 1.3.7 - Set pointer-events none for rtSkeletonPlaceholder directive
  • Version 1.4.0 - Add rtSkeletonIf directive
  • Version 1.4.1 - Fix a bug related to remapping in rtSkeletonIf directive
  • Version 1.4.2 - Fix bug related visibility for rtSkeletonIf directive (Added detectChanges)

Install

npm i rt-skeleton
yarn add rt-skeleton

Usage

rtSkeletonPlaceholderContainer

This directive sets the attribute for removing elements from DOM after loaded

rtSkeletonContainer

This directive sets the attribute for removing elements from DOM after loaded

rtSkeletonPlaceholder directive

| Option | Default | Type | Description | |-----------------------|---------|-------|-------------| | widthSkeleton | 100% | Input | | | heightSkeleton | 100% | Input | | | radiusPlaceholder | 5px | Input | | | leftSkeleton | 0 | Input | |

rtSkeletonContainer directive

| Option | Default | Type | Description | |-----------------------|---------|-------|---------------------------------| | iterations | 1 | Input | amount mock containers for load |

*rtForSkeleton extended by *ngFor directive

Import or add global style for skeleton placeholder

@import 'node_modules/rt-skeleton/styles/styles.scss';

.rt-skeleton-segment {

  background: linear-gradient(0.85turn, rgba(39, 39, 39, 0.09), rgba(39, 39, 39, 0.03), rgba(39, 39, 39, 0.09));
  animation: colorChange 2s infinite linear;

  @keyframes colorChange {
    from {
      background-position: top 0 left 0;
      background-size: 1000%
    }
    50% {
      background-position: top center;
      background-size: 1000%
    }
    to {
      background-position: top 0 right 0;
      background-size: 1000%
    }
  }
}

Use for single item

  • Note that we are creating a *rtSkeletonIf="item$ | async as data" object instead of the usual *ngIf="item$ | async"

<div rtSkeletonContainer [while]="inProgress$ | async">
    <div
            *rtSkeletonIf="item$ | async as data; else emptyList"
            class="rt-skeleton__item"
    >
        <div
                class="item__avatar"
                rtSkeletonPlaceholder
                radiusPlaceholder="50%"
                widthSkeleton="50px"
                heightSkeleton="50px"
        >
            <img class="item__avatar" src="/assets/icons/avatar_1.png" alt="">
        </div>

        <div class="item-group"><span>Name: </span>
            <div rtSkeletonPlaceholder widthSkeleton="150px"
                 class="item__value">{{data.name.first_name}}
            </div>
        </div>
        <div class="item-group"><span>Age: </span>
            <div rtSkeletonPlaceholder widthSkeleton="150px" class="item__value">{{data.age}}</div>
        </div>
        <div class="item-group"><span>address: </span>
            <div rtSkeletonPlaceholder widthSkeleton="150px" class="item__value">{{data.address}}</div>
        </div>

        <div class="item-group"><span>phone: </span>
            <div rtSkeletonPlaceholder widthSkeleton="150px" class="item__value">{{data.phone}}</div>
        </div>


    </div>
    <ng-template #emptyList>The list is empty</ng-template>
</div>

Use for list


<div
  rtSkeletonContainer
  [iterations]="5"
  [while]="inProgress$ | async"
  class="rt-skeleton-example__container"
>
  <div
    class="rt-skeleton__item"
    *rtForSkeleton="let data of items$ | async;"
  >
    <div
      rtSkeletonPlaceholder
      radiusPlaceholder="50%"
      widthSkeleton="50px"
      heightSkeleton="50px"
      class="item__avatar"
    >
      <img class="item__avatar" src="/assets/images/profile/avatar-list/avatar_1.png" alt="">
    </div>

    <div class="item-group">
      <div>Name:</div>
      <div class="item__value" rtSkeletonPlaceholder widthSkeleton="150px">{{data.name.first_name}}</div>
    </div>
    <div class="item-group">
      <div>Age:</div>
      <div class="item__value" rtSkeletonPlaceholder widthSkeleton="150px">{{data.age}}</div>
    </div>
    <div class="item-group">
      <div>Address:</div>
      <div class="item__value" rtSkeletonPlaceholder widthSkeleton="150px">{{data.address}}</div>
    </div>
    <div class="item-group">
      <div>Phone:</div>
      <div class="item__value" rtSkeletonPlaceholder widthSkeleton="150px">{{data.phone}}</div>
    </div>

  </div>
</div>

https://www.regulus.team/