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

react-native-skeleton-loaders

v1.5.0

Published

<div align="center"> <img width="300" alt="Screenshot 2023-01-08 at 08 50 02" src="https://user-images.githubusercontent.com/20539827/211187913-f52bd263-a459-4084-bb42-c9a641a04558.png"> </div>

Downloads

398

Readme

npm version

A small, intuitive, type-safe package for simple skeleton loaders that you can add whilst your app is in a loading state.

Table of contents

Install

npm install react-native-skeleton-loaders

Or:

yarn add react-native-skeleton-loaders

How it works

Whilst waiting for data to load, to give the impression to the user that things are ticking along, you can add a skeleton loader. You can simply construct a layout of skeleton elements that match up with the eventual layout when the data has loaded:

const DataList = ({ isLoading }) => {
  return isLoading ? (
    <SkeletonGroup numberOfItems={3} direction="row" stagger={{ delay: 3 }}>
      <Skeleton w={100} h={100} />
    </SkeletonGroup>
  ) : (
    <Layout>
      <App />
    </Layout>
  );
};

Component API

<Skeleton />

| Prop | Type | Default Value | | ----------------------- | -------------------- | ------------------------------------------------------------------ | | w (width) | number | | h (height) | number | | bR (borderRadius) | number | 3 | | mX (marginHorizontal) | number | 2 | | mY (marginVertical) | number | 2 | | color | string | '#ebebeb' | | speed | 400,500,700 | 500 | | circle | { radius: number } | If you use this, then w and h will be overridden by the radius |

For a single skeleton element, import <Skeleton />:

import { Skeleton } from "react-native-skeleton-loaders";

<Skeleton w={200} h={50} />

single-skeleton2

<SkeletonGroup />

| Prop | Type | Default Value | Notes | | --------------- | ------------------------ | -------------- | ---------------------------------------------------------------------- | | numberOfItems | number | | There isn't a limit on how many items you can do, so use common sense! | | direction | row,column | row | This mirrors the flex property, so goes vertically or horizontally | | stagger | { delay: number } | { delay: 3 } | | children | ReactElement<Skeleton> | | This React child must be a <Skeleton /> component |

If you want to have a group of skeleton elements, you can add a <SkeletonGroup />:

import { SkeletonGroup, Skeleton } from "react-native-skeleton-loaders";

<SkeletonGroup numberOfItems={4}>
  <Skeleton w={100} h={100} />
</SkeletonGroup>

single-skeleton4

Staggering child elements

If you want the skeleton animation to be staggered in a more traditional skeleton animation way, you can simply add the stagger prop along with the delay for each element:

import { SkeletonGroup, Skeleton } from 'react-native-skeleton-loaders'

<SkeletonGroup numberOfItems={3} direction="row" stagger={{ delay: 3 }}>
  <Skeleton w={100} h={100} />
</SkeletonGroup>

<SkeletonGroup numberOfItems={3} direction="row" stagger={{ delay: 3 }}>
  <Skeleton w={100} h={100} />
</SkeletonGroup>

<SkeletonGroup numberOfItems={3} direction="row" stagger={{ delay: 3 }}>
  <Skeleton w={100} h={100} />
</SkeletonGroup>

multiple-2

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT