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-dynamic-skeletons

v0.7.0

Published

React Native Dynamic Skeletons is an easy, customizable, and dynamic solution to create beautiful loading experiences in your React Native apps.

Downloads

1,629

Readme

React Native Dynamic Skeletons

npm version

React Native Dynamic Skeletons is an easy, customizable, and dynamic solution to create beautiful loading experiences in your React Native apps.

This library provides a simple and intuitive way to create dynamic skeletons that mimic the appearance of your app's content.

The skeletons can be easily customized to match your app's design, and the library provides a wide range of options to create dynamic and engaging loading experiences.

Developed in Typescript, this library is fully compatible with both iOS and Android. And it's also compatible with Expo.

This library does not use any third-party dependencies, and it's fully customizable.

You decide how the skeleton should look like. By providing a custom component, you can create skeletons that match your app's design.

You can use react-native-linear-gradient, expo-linear-gradient, react-native-skia or any other library.

Table of Contents

Installation

  npm install react-native-dynamic-skeletons

or:

  yarn add react-native-dynamic-skeletons

Usage

import react-native-dynamic-skeletons

import { SkeletonContainer } from 'react-native-dynamic-skeletons';

Wrap your content with SkeletonContainer and provide the Gradient component.

import { LinearGradient } from 'expo-linear-gradient';
import {
  SkeletonContainer,
  GradientProps,
} from 'react-native-dynamic-skeletons';

const Gradient = (props: GradientProps) => <LinearGradient {...props} />;
export default function App() {
  return (
    <SkeletonContainer
      isLoading={true}
      Gradient={Gradient}
    >
      <View
        style={{
          backgroundColor: 'red',
          width: 100,
          height: 100,
          borderRadius: 50,
        }}
      />
      <Text>My App</Text>
      <Text>Some content</Text>
    </SkeletonContainer>
  );
}

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | isLoading | boolean | required | Whether the skeleton should be displayed or not. animationType | 'leftRight' | 'rightLeft' | 'topBottom' | 'bottomTop' | 'leftRight' | The animation direction. Descripted in the Animation Types section. colors | string[] | ['#e1e1e1', '#f2f2f2', '#e1e1e1'] | The colors of the gradient. style | ViewStyle | { backgroundColor: '#e1e1e1' } | The style of the skeleton. duration | number | 1000 | The duration of the animation in milliseconds. Gradient | function that returns gradient component | required | The gradient component. It can be react-native-linear-gradient, expo-linear-gradient, react-native-skia or any other library.

Animation Types

The animation type can be one of the following:

| Type | Description | | --- | --- | | leftRight | The skeleton moves from left to right. | | rightLeft | The skeleton moves from right to left. | | topBottom | The skeleton moves from top to bottom. | | bottomTop | The skeleton moves from bottom to top. |

Left to Right

Right to Left

Top to Bottom

Bottom to Top