Playground

Skeleton

A still placeholder shaped like the content that is loading.

  • Built on native elements
  • aria-hidden: it carries no information.
  • Pair with an aria-busy region or a Spinner so loading is announced once.
  • Styles in one file: 13-loading.css

Import

import '@monoline/css';
import {Skeleton} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add skeleton

Usage

import {Skeleton} from '@monoline/react';

<div style={{display: 'grid', gap: 'var(--s3)', maxWidth: 420}}>
  <Skeleton style={{width: '60%'}} />
  <Skeleton style={{width: '90%'}} />
  <Skeleton variant="hatch" />
</div>

Examples

Lines and block

Props

SkeletonProps

PropTypeDefaultDescription
variant"line" | "block" | "hatch"'line'`block` is a tall panel; `hatch` shows the hatch pattern.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

This component sets no state attributes.

CSS classes

ClassStylesheet
.skeleton13-loading.css
.skeleton-block13-loading.css
.skeleton-hatch13-loading.css
.spinner13-loading.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.skeleton {
  border-color: var(--accent);
}

Accessibility

  • aria-hidden: it carries no information.
  • Pair with an aria-busy region or a Spinner so loading is announced once.