Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions components/Skeleton/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Skeleton Component

The **Skeleton** component provides a visual placeholder while content is loading.
It uses a smooth shimmer animation and customizable dimensions.

## Props

| Prop | Type | Default | Description |
|------|------|----------|-------------|
| `width` | `string` | `100%` | Sets the width of the skeleton block |
| `height` | `string` | `20px` | Sets the height of the skeleton block |
| `borderRadius` | `string` | `8px` | Rounds the corners of the skeleton |

## Example

```jsx
import Skeleton from "./Skeleton";

export default function Example() {
return (
<>
<Skeleton width="200px" height="20px" />
<Skeleton width="100%" height="40px" borderRadius="12px" />
</>
);
}
28 changes: 28 additions & 0 deletions components/Skeleton/Skeleton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";

const Skeleton = ({ width = "100%", height = "20px", borderRadius = "8px" }) => {
const style = {
width,
height,
borderRadius,
background: "linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%)",
backgroundSize: "200% 100%",
animation: "skeleton-loading 1.5s infinite ease-in-out",
};

return (
<>
<style>
{`
@keyframes skeleton-loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
`}
</style>
<div style={style}></div>
</>
);
};

export default Skeleton;
11 changes: 11 additions & 0 deletions components/Skeleton/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Skeleton",
"description": "A loading placeholder component with shimmer animation.",
"props": {
"width": "string (default: 100%)",
"height": "string (default: 20px)",
"borderRadius": "string (default: 8px)"
},
"category": "Feedback",
"framework": "React"
}