Giter Club home page Giter Club logo

react-native-easy-content-loader's Introduction

NPM Version Downloads Stats

Example's react-native-easycontent-loader

Provide a placeholder at the place which need waiting for loading, Easy to implement and fun to use

Features

  • ⚙️ Customizable: Feel free to change the colors, speed, sizes, paragraphs, title and much more.;
  • ⚛️ Lightweight: Lightweight with only neccessory code.;

Index

Getting Started

npm install react-native-easy-content-loader --save
yarn add react-native-easy-content-loader

Usage

import ContentLoader, { Facebook, Instagram, Bullets } from 'react-native-easy-content-loader';
<ContentLoader active />

Options

These Options are common with every component,

primaryColor?: string, rgba/hex

Defaults to rgba(220, 220, 220, 1).

secondaryColor? string, rgba/hex

Defaults to rgba(200, 200, 200, 1).

animationDuration? number

Defaults to 500. The animation transition time from primaryColor to secondaryColor

loading?: bool | null

Defaults to null, If given a bool value, when false, it will return children (Works as a wrapper component)

active? bool

Defaults to false, true if you want to animate the compoennt.

title? bool

Defaults to true. If you want to show the title, Works only with ContentLoader.

titleStyles? object

Add styles to title.

listSize? number

Defaults to 1. If you want to render a list of loaders, Works with all the loaders.

avatar? bool

Defaults to false. If you want to render the avatar.

aShape? string 'circle' | 'square'

Defaults to circle. shape of the avatar, can be circle or square.

aSize? string 'default' 'small' 'large' | number

Defaults to default. can be a specific number.

reverse? bool

Defaults to false. if you want to reverse the view.

containerStyles? object

If you want to add style to container.

Title specific options.

tHeight? string | number

Used to change the title height.

tWidth? stirng | number

Used to change the title width.

sTHeight? string | number

Used to change the secondary title height Works with only Facebook and Instagram.

sTWidth? string | number

Used to change the secondary title width Works with only Facebook and Instagram.

titleStyles? object

Add styles to title.

secondaryTitleStyles? object

Add styles to secondaryTitle. Works with only Facebook and Instagram.

Paragraph specific options.

pHeight? string | number

Paragraph line height

pWidth? string | number | array

Can specify same width with single value, Or could use array for different widths, eg ['100%', 200, 300]

paragraphStyles? objecct

Add paragraph styles

Instagram specific options.

imageHeight? number

Change the height of the image

imageStyles? number

Add styles to image

Examples

Simple Example

<ContentLoader active />

With Avatar

<ContentLoader active avatar />

With Loading State

<ContentLoader active avatar loading={this.state.loading}>
  <Text>This would be rendered with loading is false</Text>
</ContentLoader>

Number of paragraphs

<ContentLoader active avatar pRows={4} />

Different Widths for differnt paragrahs lines

<ContentLoader active avatar pRows={4} pWidth={["100%", 200, "25%", 45]} />

Facebook Style

import { Facebook } from 'react-native-easy-content-loader';

<Facebook active />

Facebook Style

Instagram Style

import { Instagram } from 'react-native-easy-content-loader';

<Instagram active />

Instagram Style

Bullets Style

import { Bullets } from 'react-native-easy-content-loader';

<Bullets active listSize={10} />

Bullets Style

Default Style

It is highly customizable, please refer the options sections.

import ContentLoader from 'react-native-easy-content-loader';

<ContentLoader active listSize={10} />

ContentLoader Style

ContentLoader Style

                       |

Release History

See CHANGE_LOG.md.

Contributing

Feel free to contribute, this is still in beta and I have plans to include more features in future :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.