Socket
Socket
Sign inDemoInstall

react-native-skeleton-views

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-skeleton-views

This is a loading skeleton for React Native


Version published
Maintainers
1
Created
Source

react-native-skeleton-view

This is simple loading skeleton for React Native

Installation

Note: This package is required react-native-linear-gradient

Step 1

Install react-native-linear-gradient Using npm :

npm install react-native-linear-gradient

If you are running a react-native version below 0.60:

react-native link react-native-linear-gradient
Step 2
npm install react-native-skeleton-view

Usage

Simple Usage

import SkeletonView from 'react-native-skeleton-view';

// ...

<SkeletonView style={{height: 12, width: 150, marginStart: 16, marginBottom: 8, borderRadius: 120}} />

Full usage

import React from 'react';
import {StyleSheet, View} from 'react-native';
import SkeletonView from 'react-native-skeleton-view';

const App = () => {
  return (
    <View style={styles.Wrapper}>
      <View style={styles.Card}>
        <SkeletonView
          style={styles.SkeletonProfile}
          duration={1500}
        />
        <View style={{marginTop: 8}}>
          <SkeletonView
            style={{height: 12, width: 125, marginStart: 16, marginBottom: 8, borderRadius: 120}}
          />
          <SkeletonView
            style={{height: 12, width: 150, marginStart: 16, marginBottom: 8, borderRadius: 120}}
          />
          <SkeletonView
            style={{height: 12, width: 150, marginStart: 16, marginBottom: 8, borderRadius: 100}}
          />
        </View>
      </View>
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  Wrapper: {padding: 16},
  SkeletonProfile: {
    width: 80,
    height: 80,
    borderRadius: 80
  },
  Card: {
    padding: 24,
    borderWidth: 1,
    borderColor: '#DEDEDE',
    borderRadius: 20,
    flexDirection: 'row',
    alignItems: 'center'
  }
})

Props

NameDescriptionDefault
backgroundColorFor change background color skeleton#E2E9ED
highlightColorFor change highlight color skeleton#D9E0E3
durationFor change duration animation skeleton1000
styleFor custom style skeletonNone

Contributing

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

License

MIT

Keywords

FAQs

Package last updated on 06 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc