Skip to content

Components · Status and feedback

Skeleton

Loading placeholder shapes.

@rookcom/monarch-reactComponent

Shapes

Usage examples

The example at the top of the page is the only one for this component.

Purpose

A placeholder shape that holds the layout while content loads.

Use when

  • Building a custom loading layout that mirrors the final content.

Avoid when

  • A standard list, card grid or detail view: use LoadingState, which also announces loading.

Design principles

  • Hidden from assistive technology: mark the loading region aria-busy="true" and announce completion separately.

API reference

import { Skeleton } from '@rookcom/monarch-react';
ExportKindRenderingRoot class
Skeletoncomponentserver-safe.mn-skeleton

width and height are merged into style.

Generated from the TypeScript declarations of packages/react/src/components/feedback/skeleton.

Properties

Skeleton

Loading placeholder. Hidden from assistive technology: mark the loading region with aria-busy="true" and announce completion separately.

PropTypeDescription
childrenReactNode
classNamestring
heightimport("/home/runner/work/monarch/monarch/node_modules/csstype/index").Property.Height<string | number>
idstring
shape"circle" | "rect" | "text"
widthimport("/home/runner/work/monarch/monarch/node_modules/csstype/index").Property.Width<string | number>

Variants

PropValuesDescription
shape'rect''text''circle'Default rect. text is 0.75em high; circle is fully rounded. Exposed as data-shape.

States

StateExposed asBehaviour
Animating–A shimmer animation runs; it is turned off with reduced motion.

Interaction behaviour

  • None.

Keyboard support

Not interactive, so there is no keyboard behaviour.

Accessibility

Role
none (aria-hidden)
Accessible name
–
  • Always aria-hidden.
  • prefers-reduced-motion: reduce stops the shimmer.

Responsive behaviour

  • Sizes come from width and height; percentages follow the container.

Theme support

  • Fill is --mn-color-bg-muted, so it adapts to every theme.

Do and don't

Do

  • Match the skeleton to the shape of the content that will replace it.

Don't

  • Do not rely on Skeleton to tell screen-reader users that content is loading.
  • LoadingState: Ready-made skeleton layouts with an announcement.
  • Spinner: Indeterminate progress in a small space.

Dependencies

KindDepends on
npm packagesNone
Monarch componentsNone

Testing coverage

  • Is hidden from assistive technology.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery

Tests: packages/react/src/components/feedback/skeleton