-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,101 @@ | ||
--- | ||
title: Skeleton | ||
description: A skeleton is a placeholder that represents the shape of the content that is loading. | ||
--- | ||
--- | ||
|
||
## Import | ||
|
||
- **Skeleton**: The main component to display a skeleton. | ||
|
||
## Usage | ||
|
||
<div className="flex items-center space-x-4"> | ||
<Skeleton className="h-12 w-12 rounded-full" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
|
||
```jsx | ||
import { Skeleton } from "@openlite/ui" | ||
|
||
export function SkeletonDemo() { | ||
return ( | ||
<div className="flex items-center space-x-4"> | ||
<Skeleton className="h-12 w-12 rounded-full" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
``` | ||
|
||
## Examples | ||
|
||
### Button Skeleton | ||
|
||
<Skeleton className="h-10 w-28" rounded="lg" /> | ||
|
||
```jsx | ||
import { Skeleton } from "@openlite/ui" | ||
|
||
export function SkeletonButtonDemo() { | ||
return ( | ||
<Skeleton className="h-10 w-28" rounded="lg" /> | ||
) | ||
} | ||
``` | ||
|
||
### CArd Skeleton | ||
|
||
<div className="flex flex-col gap-3 max-w-sm"> | ||
<Skeleton className="w-full h-52" rounded="lg" /> | ||
<div className="space-y-2 p-2"> | ||
<Skeleton className="h-4 w-[150px]" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-4 w-[100px]" /> | ||
<div className='grid grid-cols-2 gap-4' > | ||
<Skeleton className="h-10 w-full" rounded="lg" /> | ||
<Skeleton className="h-10 w-full" rounded="lg" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
```jsx | ||
import { Skeleton } from "@openlite/ui" | ||
|
||
export function SkeletonCardDemo() { | ||
return ( | ||
<div className="flex flex-col gap-3 max-w-sm"> | ||
<Skeleton className="w-full h-52" rounded="lg" /> | ||
<div className="space-y-2 p-2"> | ||
<Skeleton className="h-4 w-[150px]" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-2 w-full" /> | ||
<Skeleton className="h-4 w-[100px]" /> | ||
<div className='grid grid-cols-2 gap-4' > | ||
<Skeleton className="h-10 w-full" rounded="lg" /> | ||
<Skeleton className="h-10 w-full" rounded="lg" /> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
``` | ||
|
||
## API | ||
|
||
### Skeleton Props | ||
|
||
| Props | Type | Description | | ||
| --- | --- | --- | | ||
| `rounded` | `'none' \| 'sm' \| 'md' \| 'lg'` | The rounded of the Skeleton. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters