Skeleton
A loading placeholder with content-shaped geometry.
A loading placeholder with content-shaped geometry.
Import
Section titled “Import”import { Skeleton } from "@zentara-co/zenos-ui";Content-shaped placeholders
Section titled “Content-shaped placeholders”Build loading layouts from the same rough geometry as the content they replace. This reduces layout shift and helps users understand what kind of information is arriving.
Repeated content
Section titled “Repeated content”Keep repeated placeholders simple and consistent with the loaded rows. Small width changes can suggest natural text variation without making the loading surface visually noisy.
Loading state
Section titled “Loading state”Skeleton is visual and always hidden from assistive technology. Put aria-busy on the region being updated and provide concise status text when loading begins. Replace the entire placeholder composition with real content when the request completes.
Custom styling
Section titled “Custom styling”Use className to override the surface color, corner radius, and dimensions. Prefer semantic
tokens so custom placeholders remain visible across themes. The built-in pulse and reduced-motion
behavior remain unless the application explicitly overrides the animation.
Sizing
Section titled “Sizing”Shapes define geometry, not dimensions. Use layout utilities through className to match the eventual content: width for text, width and height for rectangles, and one square dimension for circles.
Variants
rectangletextcircle API
| Prop | Type | Default | Description |
|---|---|---|---|
shape | rectangle | text | circle | rectangle | Placeholder geometry. |
native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Every Skeleton has aria-hidden="true" because placeholder geometry is not meaningful content. Announce loading from the surrounding region and avoid placing interactive controls inside a skeleton. The pulse animation follows the application’s reduced-motion CSS behavior; loading must remain understandable without motion.