Skip to content

Commit

Permalink
docs: component skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
gerzon05 committed Oct 12, 2024
1 parent 103d016 commit caa6615
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
99 changes: 98 additions & 1 deletion docs/content/docs/components/skeleton.mdx
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. |
2 changes: 2 additions & 0 deletions docs/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import {
SelectTrigger,
SelectValue,
Separator,
Skeleton,
Slider,
Tooltip,
TooltipContent,
Expand Down Expand Up @@ -175,6 +176,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
Accordion,
Accordions,
Slider,
Skeleton,
InstallTabs: ({
items,
children,
Expand Down

0 comments on commit caa6615

Please sign in to comment.