1.1.3 • Published 1 year ago

@shayan-mirzaie/skeleton-react v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Skeleton React

easy to use library for skeleton loading.

coming soon

  • new components
  • several animation mode
  • global colour and size registry
  • dark mode
  • vue.js implementation
  • react native implementation

installation

Using npm:

$ npm i @shayan-mirzaie/skeleton-react

Using yarn:

$ yarn add @shayan-mirzaie/skeleton-react

Usage

simply import the package

import Skeleton from "@shayan-mirzaie/skeleton-react";

then use <Skeleton> component to see the result :

<Skeleton>
    <Skeleton.Circle />
    <Skeleton.Rect />
    <Skeleton.Rect width="75%" />
</Skeleton>

Api

namedescriptionpropschildren
Skeletonwrapper component of libraryenable boolean dir rtl\|ltrYES
Skeleton.Rectshow rectangle shapeheight string ex: 20px width string ex: 20px margin string ex: 20px full boolean onClick callback function
Skeleton.Squareshow square shapewidth string ex: 20px margin string ex: 20px onClick callback function
Skeleton.Circleshow circle shaperadius string ex: 20px margin string ex: 20px onClick callback function
Skeleton.Rowshow children item in a rowalignItems center\|start\|end\|baseline justifyContent center\|start\|end\|space-around\|space-between onClick callback functionYES
Skeleton.Colshow children item in a columnalignItems center\|start\|end\|baseline justifyContent center\|start\|end\|space-around\|space-between onClick callback functionYES
Skeleton.Centershow children item centeronClick callback functionYES
Skeleton.Listiterate children item to show a listcount numberYES

Examples

  • post view

<Skeleton>
    <Skeleton.Row alignItems="center" justifyContent="space-between">
        <Skeleton.Circle radius="40px" />
        <Skeleton.Rect width="70px" height="20px" />
    </Skeleton.Row>
    <Skeleton.Rect height="220px" />
</Skeleton>
  • list view
<Skeleton>
    <Skeleton.List count={4}>
        <Skeleton.Row>
            <Skeleton.Circle />
            <Skeleton.Col>
                <Skeleton.Rect />
                <Skeleton.Rect width="50%" />
            </Skeleton.Col>
        </Skeleton.Row>
    </Skeleton.List>
</Skeleton>
1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago