You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

react-skeleton-loader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-skeleton-loader

A react helper for skeleton loaders


Version published
Weekly downloads
1.3K
increased by2.7%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React Skeleton Loader

npm version gzip size

React Skeleton Loader is a React component designed to help you easily integrate custom animated skeletons for loading states. It best works with text elements as it adopts to the fonts size and line height of your content, but it can be easily fitted to use with other objects like images and avatars.

Demo

Click here 👌

Basic Usage

The components you create should have loading states embeded in them. You can do this however you want. You could rely on state changes, promise responses, or simply checking if the props passed aren't undefined.

import Skeleton from 'react-skeleton-loader';

const Page = (props) => {
  return(
    <div>
      <h1>props.title | <Skeleton /></h1>
      <p>props.body | <Skeleton count={5} /></p>
    </div>
  )
}

Props

PropTypeDefaultDescription
widthstring"150px"The (max) width of the element
heightstring"100%"The (max) height of your element
widthRandomnessnumber0.25Amount of width randomness
heightRandomnessnumber0Amount of height randomness
borderRadiusstring8pxborder radius of the element
colorstring#EFF1F6the background color of the element
countnumber1How many time should this be repeated
animatedbooleantrueIf it should animate

When using widthRandomness or heightRandomness the maximum width and height will be determined by width and height props. It can then only decrease. For example if widthRandomness is set to 0.25, and width is set to 100px the width will vary between 100px and 75px.

Licence

MIT

Keywords

FAQs

Package last updated on 03 Jan 2019

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc