-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(skeleton): added Skeleton Loading with Examples
- Loading branch information
1 parent
40e4e87
commit c5775eb
Showing
29 changed files
with
1,146 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
title: React Skeleton - Flowbite | ||
description: The skeleton component can be used as an alternative loading indicator to the spinner by mimicking the content that will be loaded such as text, images, or video | ||
--- | ||
|
||
Use the skeleton component to indicate a loading status with placeholder elements that look very similar to the type of content that is being loaded such as paragraphs, heading, images, videos, and more. | ||
|
||
You can set the width and height of these skeleton components based on the size of the content and element that it is being loaded in, such as a card or an article page. | ||
|
||
Start using the skeleton component by importing it from the `flowbite-react` library: | ||
|
||
```jsx | ||
import { Skeleton } from "flowbite-react"; | ||
``` | ||
|
||
# Variants | ||
|
||
## Default | ||
|
||
Represents a single line of text. | ||
|
||
<Example name="skeleton.root" /> | ||
|
||
## Circular | ||
|
||
<Example name="skeleton.circular" /> | ||
|
||
## Rectangular | ||
|
||
<Example name="skeleton.rectangular" /> | ||
|
||
## Rounded | ||
|
||
<Example name="skeleton.rounded" /> | ||
|
||
# Examples | ||
|
||
## Image placeholder | ||
|
||
This example can be used to show a placeholder when loading an image and text content. | ||
|
||
<Example name="skeleton.image" /> | ||
|
||
## Video placeholder | ||
|
||
Use this example to show a skeleton placeholder when loading video content. | ||
|
||
<Example name="skeleton.video" /> | ||
|
||
## Card placeholder | ||
|
||
Use this example to show a placeholder when loading content inside a card. | ||
|
||
<Example name="skeleton.card" /> | ||
|
||
## List placeholder | ||
|
||
Use this example to show a placeholder when loading a list of items. | ||
|
||
<Example name="skeleton.list" /> | ||
|
||
## Testimonial placeholder | ||
|
||
Use this example to show a placeholder when loading a list of items. | ||
|
||
<Example name="skeleton.testimonial" /> | ||
|
||
# Theme | ||
|
||
To learn more about how to customize the appearance of components, please see the [Theme docs](/docs/customize/theme). | ||
|
||
<Theme name="skeleton" /> | ||
|
||
# References | ||
|
||
- [Flowbite Skeleton](https://flowbite.com/docs/components/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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export { card } from "./skeleton.card"; | ||
export { circular } from "./skeleton.circular"; | ||
export { image } from "./skeleton.image"; | ||
export { list } from "./skeleton.list"; | ||
export { rectangular } from "./skeleton.rectangular"; | ||
export { rounded } from "./skeleton.rounded"; | ||
export { root } from "./skeleton.root"; | ||
export { testimonial } from "./skeleton.testimonial"; | ||
export { video } from "./skeleton.video"; |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { SkeletonCard } from "flowbite-react"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
'use client'; | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton.Card /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { SkeletonCard } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonCard /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonCard /> | ||
</div> | ||
); | ||
} | ||
|
||
export const card: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
{ | ||
fileName: "server", | ||
language: "tsx", | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: "skeleton/skeleton.card.tsx", | ||
component: <Component />, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Skeleton } from "flowbite-react"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
'use client'; | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="circular" /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="circular" /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="circular" /> | ||
</div> | ||
); | ||
} | ||
|
||
export const circular: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
{ | ||
fileName: "server", | ||
language: "tsx", | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: "skeleton/skeleton.circular.tsx", | ||
component: <Component />, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { SkeletonImage } from "flowbite-react"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
'use client'; | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton.Image /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { SkeletonImage } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonImage /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonImage /> | ||
</div> | ||
); | ||
} | ||
|
||
export const image: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
{ | ||
fileName: "server", | ||
language: "tsx", | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: "skeleton/skeleton.image.tsx", | ||
component: <Component />, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { SkeletonList } from "flowbite-react"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
'use client'; | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton.List /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { SkeletonList } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonList /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div> | ||
<SkeletonList /> | ||
</div> | ||
); | ||
} | ||
|
||
export const list: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
{ | ||
fileName: "server", | ||
language: "tsx", | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: "skeleton/skeleton.list.tsx", | ||
component: <Component />, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Skeleton } from "flowbite-react"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
'use client'; | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="rectangular" /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { Skeleton } from "flowbite-react"; | ||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="rectangular" /> | ||
</div> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div> | ||
<Skeleton variant="rectangular" /> | ||
</div> | ||
); | ||
} | ||
|
||
export const rectangular: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
{ | ||
fileName: "server", | ||
language: "tsx", | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: "skeleton/skeleton.rectangular.tsx", | ||
component: <Component />, | ||
}; |
Oops, something went wrong.