Skip to content
Components / Composition

Loading

Paints real components as their own skeleton while data loads, with no layout shift.

@fabrials/ui
Loading state

Accounts

  • NWNorth workspaceTeamCurrent
  • RSRelay stagingPersonalStale
  • ARArchiveTeamPaused

Synthetic data. Refresh shows the same list as its skeleton for two seconds.

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Loading, placeholderText, placeholderList, useLoading } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
whenbooleanShows the skeleton. The children stay mounted, so nothing moves when it turns off.
labelstringWhat assistive technology hears while it loads, e.g. Loading accounts.
placeholderText(length, seed?)stringInvisible placeholder copy that wraps like real words.
placeholderList(count, make)T[]Placeholder records for lists and tables.
data-skeletonkeep | hide | block | fillOn any element inside: paint as usual, leave empty, one block, or a solid shape.

Behavior

Only paint changes (display: contents wrappers), so any width or content matches the finished view. Content is inert while loading and a status message names what loads; the pulse follows reduced motion. See the loading states guide.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.