An open API service indexing awesome lists of open source software.

https://github.com/jbkuczma/react-skeletons

Lightweight package for creating beautiful loading skeletons for your app
https://github.com/jbkuczma/react-skeletons

loading-animations react react-skeleton

Last synced: 3 months ago
JSON representation

Lightweight package for creating beautiful loading skeletons for your app

Awesome Lists containing this project

README

          

[![minifed size](https://img.shields.io/bundlephobia/min/react-skeletons.svg?style=flat-square)]()
[![minzip size](https://img.shields.io/bundlephobia/minzip/react-skeletons.svg?style=flat-square)]()
[![npm version](https://badge.fury.io/js/react-skeletons.svg)]()

# react-skeletons
Create beautiful and animated loading skeletons as your views load

## Installation

```bash
npm install --save react-skeletons
```

## Basic usage

```jsx
import Skeleton from 'react-skeletons';


```

## Advanced usage

```jsx
import React from 'react';
import Skeleton, { Box, Line } from 'react-skeletons;

const Grid = ({ ...props }) => (


{props.children}

);



{[0, 1, 2].map((_, index) =>





)}


```

View the storybook to see other possible configurations

```bash
npm run storybook
```

## Components

### Skeleton
| Prop | Type | Description | Default |
|------|------|-------------|---------|
| count | Number | How many lines should be rendered | 3 |
| animated | Boolean | Should the skeleton be animated | true |

### Line
| Prop | Type | Description | Default |
|------|------|-------------|---------|
| animated | Boolean | Should the line be animated | true |

### Box
| Prop | Type | Description | Default |
|------|------|-------------|---------|
| animated | Boolean | Should the line be animated | true |
| auto | Boolean | Fill container; set's `width` and `height` to `100%` | false |
| height | Number | Height of box (in px) | 72 |
| width | Number | Width of box (in px) | 72 |

### SkeletonTheme
| Prop | Type | Description | Default |
|------|------|-------------|---------|
| color | String | Background color | #F2F2F2 |
| highlight | String | Primary color | #E3E3E3 |