Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/yisheng90/react-loading

🤚 A loading skeleton component built on React
https://github.com/yisheng90/react-loading

component component-lib css frontend javascript library loading react react-loading skeleton-template web

Last synced: 6 days ago
JSON representation

🤚 A loading skeleton component built on React

Awesome Lists containing this project

README

        

# ![Skleton](https://res.cloudinary.com/duuqqcc3z/image/upload/v1587462403/react-loading/skull_1.svg) React Loading

[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)

[![Build Status](https://travis-ci.org/yisheng90/react-loading.png?branch=master)](https://travis-ci.org/yisheng90/react-loading)
[![codecov](https://codecov.io/gh/yisheng90/react-loading/branch/master/graph/badge.svg)](https://codecov.io/gh/yisheng90/react-loading)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)
![Publish NPM](https://github.com/yisheng90/react-loading/workflows/Publish%20NPM/badge.svg)

Loading Skleton component building block to easily create placholder loadings.

![Example](https://res.cloudinary.com/duuqqcc3z/image/upload/v1587462782/react-loading/Screen-Recording-2020-04-21-at-5.gif)

### Features

🎨 **Customizable** - You can change the color, size and shape of the skeleton

🎮 **Plug and Play** - You can just import the component and start using it

🏠 **Building block** - You can use it as a building block to build complex loading component

🧸 **Easy to adapt** - It is a react component.

### Docs

[Storybook](https://yisheng90.github.io/react-loading/?path=/docs/react-loading-welcome--page)

### Getting Started

Install via `yarn` or `npm`

```bash
npm install @yisheng90/react-loading --save
```

or

```bash
yarn add @yisheng90/react-loading
```

### Usage

There are two ways to use it.

**1. Use it as a component**

```jsx
import Skeleton from "@yisheng90/react-loading";

;
```

**2. Use it as a building block**

```jsx
import Skeleton from "@yisheng90/react-loading";

const CardSkleton = () => (








);
```

### Props

**`rows?: number`**

Defaults to 1. It is used to determine the number of rows to be display.

_notes: This option will be ignored if `circle` is set as true_

**`width?: number | string`**

Defaults to 100%. It is used to set the width of the skeleton. You can set it using `%`, `rem` or `px`.

**`height?: number | string`**

Defaults to 100%. It is used to set the height of the skeleton. You can set it using `%`, `rem` or `px`.

**`circle?: boolean`**

Defaults to false. It is used to set shape of the skleton.

**`color?: string`**

It is used to set the color of the skleton. You can set it using `hex`, `rgb` or `rgba`.

**`translucent?: boolean`**

Defaults to false. It is used to set the opacity of the skleton.

**`radius?: number`**

Defaults to 4px. It is used to determine the border radius of the rows. The unit is in `px`.

_notes: This option will be ignored if `circle` is set as true_

### Examples

#### Rows

```jsx

```

#### Width

```jsx



```

#### Height

```jsx



```

### Circle

```jsx





```

### Color

```jsx





```

### Translucent

```jsx

```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!