Skip to content
SENVENLI UI

Skeleton

Placeholder shapes in the layout of content that is still loading.
A loading list
import { Skeleton, SkeletonGroup } from "@senvenli/react/feedback";

Examples

Swapping in the content

`isLoaded` shows the children in place of the shape.

A card with a photo

`aspectRatio` holds the photo's box, and `radius` matches what it replaces.

Guidelines

When to use it

  • A layout is loading and its shape is known.

Use something else when

  • The layout of what loads is unknown or very small. Spinner
  • The task's progress can be measured. Progress

Accessibility

Built in

  • SkeletonGroup marks the region busy and announces when it has loaded.

You provide

  • A label on SkeletonGroup that says what is loading.

API reference

Skeleton

isLoaded
boolean

Shows the children instead of the shape once the data is there.

children
React.ReactNode
delay
number

Milliseconds before the shape appears (default 300); the space is held meanwhile.

variant
"text" | "circle" | "rectangle"

rectangle (default): a block of width × height; text: lines of text, the last one shorter; circle: an avatar of size px.

lines
number

text: the number of 12px lines (default 2).

size
number

circle: the diameter in px (default 32, a list avatar).

width
string | number

CSS width ("60%", 240); default full width.

height
string | number

CSS height; default 12px (a text line).

radius
"none" | "small" | "medium" | "large" | "full"

The radius of what it replaces: medium for a button, large for a card photo.

aspectRatio
string

Aspect ratio for photos ("16/9").

motion
ComponentMotion

auto (follow the device), reduce or none, for this component; the provider's setting otherwise.

SkeletonGroup

labelRequired
string

What is loading ("Loading orders"); the region's name while busy.

loadedLabel
string

The region's name once loaded ("Orders"); none by default.

isLoadingRequired
boolean
childrenRequired
React.ReactNode