Book Loader

Loader with effect of folding pages of book

Usage

Loading...
import { BookLoader } from "react-awesome-loaders";
export const BookLoaderComponent = () => {
return (
<>
<BookLoader
background={"linear-gradient(135deg, #6066FA, #4645F6)"}
desktopSize={"100px"}
mobileSize={"80px"}
textColor={"#4645F6"}
/>
</>
);
};

Parameters

Below are the parameters for BookLoader that you can customize.

OptionDescriptionTypeDefault
classNameclass attribute for loaderStringbookloader
textText to be displayed under animationStringLoading...
backgroundBackground color of the loaderStringlinear-gradient(135deg, #23c4f8, #275efe)
shadowColorColor of the book shadowStringrgba(39, 94, 254, .28)
textColorColor of the text displayedString#6c7486
pageColorColor od the pagesStringrgba(255, 255, 255, .36)
foldPageColorColor of the page when foldedStringrgba(255, 255, 255, .52)
durationDuration of animationString3s
sizeSize of the logoString64px
desktopSizeSize of the logo on desktopString(empty)
mobileSizeSize of the logo on mobileString(empty)

size, desktopSize and mobileSize attributes are defined relative to 64px for all loaders and it doesn't mean the actual size would be 64px. It means all the sizes defined will be w.r.t 64px. If you pass 128px then the size doubles. Also, note that if one of the desktopSize and mobileSize is not defined, then it will use the size attribute. Value defined in size attribute is assigned for mobile devices and loader automatically doubles the size on desktop device.

❤️ Inspired from codepen by Aaron Iker