New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-skeleton-builder

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-skeleton-builder

A versatile React component library for creating customizable skeleton loading animations with Chakra UI and TypeScript.

  • 0.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-64%
Maintainers
0
Weekly downloads
 
Created
Source

React Skeleton Builder

A lightweight React component library for building skeletons with TypeScript and Chakra UI.

Installation

npm i react-skeleton-builder

Usage

In the root of your providers

import { ReactSkeletonProvider } from 'react-skeleton-builder';

<ReactSkeletonProvider
    value={{
        // Initialy we can put empty object.
        // Check the props to customize the builder's behaviour
    }} 
>
    {children}
</ReactSkeletonProvider>

Example of Skeleton Component

You can generate the grid structure by visiting the website.

import React from 'react';
import { Skeleton } from 'react-skeleton-builder';

const ExampleComponent: React.FC = () => {
return (
<Skeleton
    styles={{
        width: '100%',
        height: '60px',
    }}
    grid={{
        children: [
            {
                w: '60px',
                skeletons: [
                    {
                        h: '60px',
                        r: '50%',
                    },
                ],
            },
            {
                direction: 'column',
                gridGap: '.5',
                skeletons: [
                    { r: '.4rem', w: '80%' },
                    { r: '.4rem', w: '60%' },
                    { r: '.4rem', w: '30%' },
                ],
            },
        ],
    }}
    />
);
};

export default ExampleComponent;

The result is this:

API

Props of ReactSkeletonProvider

PropstyperequireddefaultValue
childrenReactNodetrue
valueObject (check appropriate table)true{}

value prop consist of these:

PropstyperequireddefaultValue
isDarkbooleanfalsefalse
colorThemeObject (ColorThemes) (check appropriate table)falseDEFAULT_COLOR_THEMES
breakpointsObject (Breakpoints) (check appropriate table)falseDEFAULT_BREAKPOINTS
skeletonAnimationstringfalseSKELETON_ANIMATION_VARIANTS.SLIDE

colorTheme prop consist of these:

PropstyperequireddefaultValue
darkObject {main: string, gradient: string}true{ main: '#282c34', gradient: '#2c303a' }
lightObject {main: string, gradient: string}true{ main: '#f1f1f1', gradient: '#ececec' }

breakpoints prop consist of these:

PropstyperequireddefaultValue
mobilestringtrue576px
tabletstringtrue961px
desktopstringtrue962px >

Props of Skeleton

PropstyperequireddefaultValue
stylesObjectfalse{}
customContainerWidthnumber (breakpoints will work with that width instead of window's width)false
gridIGrid (object)true

If you encounter any issues, please visit this link.

If my builder was helpful for you, you can show your support by

You can reach out to me via:

And thanks for using my builder :)

Keywords

FAQs

Package last updated on 29 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc