
Security News
Socket Integrates With Bun 1.3’s Security Scanner API
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
@aishwaryv/react-skeleton
Advanced tools
Lightweight and minimalistic Skeleton component for ReactJs 🎉
npm install @aishwaryv/react-skeleton
Create a config array for the skeleton, omit the type if you are using Javscript -
import type {SkeletonTree} from '@aishwaryv/react-skeleton';
export const Config: SkeletonTree = [
{
name: 'container',
// 💡 You can also use className instead of passing styles directly
style: {
height: 'max-content',
width: '25rem',
display: 'flex',
flexDirection: 'column',
gap: '2rem',
},
nodes: [
{
name: 'header',
nodes: [
{
name: 'title',
style: {
height: '2rem',
width: '10rem',
borderRadius: '0.5rem',
},
},
{
name: 'subtitle',
style: {
height: '1rem',
width: '50%',
borderRadius: '0.25rem',
marginTop: '0.5rem',
},
},
],
},
{
name: 'form',
style: {
display: 'flex',
flexDirection: 'column',
gap: '1rem',
},
nodes: [
{
name: 'input-box-1',
style: {
height: '4rem',
width: '100%',
borderRadius: '0.5rem',
},
},
{
name: 'input-box-2',
style: {
height: '4rem',
width: '100%',
borderRadius: '0.5rem',
},
},
{
name: 'button',
style: {
height: '2rem',
width: '100%',
borderRadius: '0.5rem',
marginTop: '1rem',
},
},
],
},
],
},
];
You can then use Skeleton
like any other React component, passing the tree
and other attributes as needed
import React from 'react';
import {Skeleton} from '../../Skeleton';
import {Config} from './SkeletonConfig';
function App() {
return <Skeleton tree={Config} {...rest} />;
}
export default App;
Checkout demo code sandbox here - Sandbox
Property | Type | Optional | Default | Description |
---|---|---|---|---|
name | String | Yes | Unique name for each element | |
duration | Number | Yes | 1.8 | Duration of the animation in seconds |
nodes | SkeletonTree | Yes | Nested content, which creates additional skeleton elements within the node |
FAQs
Lightweight and minimalistic skeleton component for ReactJs
We found that @aishwaryv/react-skeleton demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.