Skeleton
Use to show a placeholder while content is loading.
Installation
pnpm add @heyramzi/uiUsage
import { Skeleton } from "@heyramzi/ui/shadcn/skeleton";API reference
Skeleton.Root
refbindableHTMLDivElement | null- Default
null classstring...rest- Every prop of
HTMLAttributes<HTMLDivElement>fromsvelte/elementsexceptchildren
| Prop | Type | Default |
|---|---|---|
ref bindable | HTMLDivElement | null | null |
class | string | |
...rest | Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements except children | |
Skeleton.Delay
loadingrequiredboolean- The data is on its way.
skeletonrequiredSnippet- What shows while it loads: one or more `Skeleton`s shaped like the content.
childrenrequiredSnippet- The content, drawn once loading ends and the skeleton has had its minimum time.
showDelaynumber- Default
SHOW_DELAY_MS - Ms to wait before the skeleton shows.
minVisiblenumber- Default
MIN_VISIBLE_MS - Ms the skeleton stays once it shows.
| Prop | Type | Default |
|---|---|---|
loading required The data is on its way. | boolean | |
skeleton required What shows while it loads: one or more `Skeleton`s shaped like the content. | Snippet | |
children required The content, drawn once loading ends and the skeleton has had its minimum time. | Snippet | |
showDelay Ms to wait before the skeleton shows. | number | SHOW_DELAY_MS |
minVisible Ms the skeleton stays once it shows. | number | MIN_VISIBLE_MS |