Components · Feedback
Skeleton
A gray placeholder in the shape of the content that is loading, for lists, cards and panels whose layout is known.
Also called Placeholder
import { Skeleton } from "@botiverse/raft-ui";A skeleton holds the place of content that is still loading: square blocks where avatars and tiles will be, bars where text will be. Use it when a list, card or panel loads for the first time and its layout is known. Which loading indicator fits which wait is in Choosing a component.
When to use
Variants
Accessibility
Skeletonisaria-hidden. Mark the region that is loading witharia-busy="true"until the content arrives, so assistive technology doesn't read an empty region as empty.
Rules
- Give the skeleton the shape of the content it stands for: square for avatars and tiles, bars for text. Keep it rough: the layout and the common sizes, never details only the data knows. The size rule, the 1-second wait before it shows and the rule against swapping placeholders are in Feedback.
- For the rows of a list, use the row's own skeleton rather than arranging
Skeletons by hand:InboxItemSkeleton(InboxItem) andListRowSkeleton(ListRow) are built from the row's parts, so they keep its size, and stay flat like it.
API
Skeleton
Also takes the attributes of its element.
Related
Changes
- 0.7.0 · Fixed
Skeletonstops pulsing underprefers-reduced-motion.