Skip to Content
BBRICKSv0.7.4
KitOverlays

DialogSkeleton

The v3 mock's .skel: a 120px block, then lines (every other one shorter), shimmering unless motion is reduced.

import { DialogSkeleton } from '@ergasti/bricks';

Examples

Dialog body placeholder

The shape Modal and Drawer draw while loading; you can place it yourself when you load a panel in your own container.

Code
import { DialogSkeleton } from '@ergasti/bricks';

function Placeholder() {
  return <div style={{ maxWidth: 420, background: 'var(--card)', borderRadius: 22, padding: 20 }}><DialogSkeleton /></div>;
}

Props

Prop

Type

Labels

Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key dialog, or with the component's own prop where it has one. A {name} is a value the component fills in.

dialog
KeyEnglishArabic
closeCloseاقفل
loadingLoading…جارٍ التحميل…

Design guidance

How the BRICKS design system uses DialogSkeleton. Written in docs/content/components/DialogSkeleton.md; the props above are read from the code, which wins where the two disagree.

The single loading placeholder a drawer or modal shows while its data loads: a 120px block then shimmering lines; Drawer and Modal draw it for you with loading.

DialogSkeleton is the v3 mock's .skel: six grey bars, the first a 120px rounded block (the head tile), the rest 16px lines with every other one at 70 % width. They shimmer unless the user prefers reduced motion. It is one role="status" named "Loading…", so assistive tech hears one announcement instead of six shapes.

Anatomy

  1. Container (div.kit-dlg-skel, role="status", aria-label="Loading…", data-skeleton).
  2. Bars (6 × i, aria-hidden): first 120px / radius 20; others 16px / radius 8, 14px apart; even ones 70 % wide.

Variants

None.

States

StateTriggerLook
Shimmerdefault1s linear gradient sweep
Reduced motionprefers-reduced-motionStatic bars

Usage

Usually implicit:

function CreatorDrawer({ id, onClose }: { id: number | null; onClose: () => void }) {
  const drawer = useDrawerResource<{ name: string; joined: string }, { id: number }>(id === null ? null : `/creators/${id}`, id === null ? null : { id });
  return (
    <Drawer open={drawer.open} loading={drawer.loading} title={drawer.data?.name ?? ''} onClose={onClose}>
      {drawer.data && <KeyValue items={[{ label: 'Joined', value: drawer.data.joined }]} />}
    </Drawer>
  );
}

Directly, in your own overlay body:

{loading ? <DialogSkeleton /> : <ReceiptCard {...receipt} />}

Where it appears

Guidelines

Do

  • Use loading on Drawer / Modal instead of rendering it yourself.
  • Show the row's known data (title, avatar) in the header while it loads.

Don't

  • Don't use it for page-level loading; use the list's own skeleton (DataTable loading) or AsyncBlock.

RTL and Arabic

  • Bars start at the inline start, so the short lines end on the left in Arabic.

Tokens

None (fixed #EEF0F4 / #F8F9FB gradient).

Accessibility

  • role="status" with "Loading…" / "جارٍ التحميل…"; bars hidden.

Found in the source

  • Roles in the markup: status, dialog.
  • ARIA attributes set: aria-label, aria-hidden, aria-modal, aria-labelledby, aria-busy.
  • It traps focus while open and returns it on close.
  • It locks the page behind it (inert, no scroll) while open.
  • Its tests cover: “is a light, labelled modal dialog with a labelled close button and a scrim”; “moves focus in, traps Tab, closes on Escape and returns focus to the opener”.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: useFocusTrap · useModalLock · DetailsBars · DetailsDrawer

Source

src/kit/Dialog.tsx (line 43) on GitHub.

On this page