1.1.1 • Published 11 months ago

react-styled-loading-skeleton v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-styled-loading-skeleton

Animated loading skeleton on styled-components based for React.

Description

This package provides a stub component that can be used while the main content of the site is loading. The component can be modified for different types of content: round avatars, composition.

Features

  • Suitable for React.
  • Easy to integrate.
  • Easy to modify.
  • It can be used for any purpose where you need to show the process of loading content blocks.

Installation

Install the package via npm:

npm install --save react-styled-loading-skeleton

Demo

You can check storybook live demo

Use

Once installed, import the component and use it in your app:

import {  Skeleton} from 'react-styled-loading-skeleton';

// ...

function App() {

// ...

    return (
        { loading
         ? <Skeleton />
         : <div>Your Content</div>
        }
    );
}

If you need to change the visual representation of the Skeleton boot component, you can pass props for modification.

PropDescriptionDefault
width?: numberWidth in pixelsundefined
widthPercentage?: numberWidth as a percentage100%
height?: numberHeight in pixelsfont size
heightPercentage?: numberHeight as a percentage100%
rounded?: numberRounding borders in pixels (border-radius)none
roundedPercentage?: numberRounding borders as a percentagenone
isCircle?: booleanRound to the shape of a circlefalse
duration?: numberAnimation duration (ms)1500
timingFunc?: CSSProperties'animationTimingFunction'Animation typeease-in-out
baseColor?: stringPrimary background color#e9e9e9
highlightColor?: stringHighlight color animation#f9f9f9
gradient?: stringBackground gradient. background-image: linear-gradient()90deg, #e9e9e9, #f9f9f9, #e9e9e9
count?: numberNumber of skeletons per rowundefined
flex?: { direction?: CSSProperties'flexDirection'; gap?: CSSProperties'gap'; justifyContent?: CSSProperties'justifyContent'; alignItems?: CSSProperties'alignItems'; }Align skeletons in a row column. Must be used in conjunction with count!undefined
withoutAnimation?: booleanDisable animationfalse
style?: CSSPropertiesAny css propertiesundefined

License

This project is distributed under the MIT license.

1.1.1

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago