Skip to content

Skeleton

A grey shape that holds the place of content that is on its way. It has the size of what will arrive, so the page does not jump.

import { Skeleton, SkeletonWords, SkeletonOf } from '@sypnia/ui/react'

On this page
  1. Shapes
  2. A list that loads
  3. Words and pieces
  4. Pieces that load in their real shape
  5. Cards on their way
  6. When to use it
  7. For everyone
  8. Props

Shapes

A circle, a line and blocks, each with its own size.

Code
import { Skeleton } from '@sypnia/ui/react';

// The pieces: a line, a block, a circle. Each takes the size of what will replace it.
export default function Shapes() {
  return (
    <div className="sy-row" aria-busy="true">
      <Skeleton circle height={40} />
      <Skeleton width={180} />
      <Skeleton width={96} height={32} radius={10} />
      <Skeleton width={220} height={80} radius={14} />
    </div>
  );
}

A list that loads

Press «Load again»: the skeleton has the shape of the rows that arrive.

Team

LMLaura MéndezOwnerDRDiego RuizEditorACAna CastañoViewer
Code
import { useState } from 'react';
import { Button, Identity, Panel, Skeleton } from '@sypnia/ui/react';

const team = [['Laura Méndez', 'Owner'], ['Diego Ruiz', 'Editor'], ['Ana Castaño', 'Viewer']];
// Press «Load again»: the skeleton has the shape of the list that arrives, so nothing jumps.
export default function Loading() {
  const [loading, setLoading] = useState(false);
  const reload = () => { setLoading(true); setTimeout(() => setLoading(false), 2200); };
  return (
    <Panel title="Team" actions={<Button size="sm" disabled={loading} onClick={reload}>Load again</Button>}>
      <div className="sy-stack" aria-busy={loading} aria-live="polite">
        {team.map(([name, role]) => loading
          ? <div key={name} className="sy-row"><Skeleton circle height={32} /><div className="sy-stack sy-grow"><Skeleton width="38%" /><Skeleton width="22%" /></div></div>
          : <Identity key={name} name={name} meta={role} />)}
      </div>
    </Panel>
  );
}

Words and pieces

The loaded row and the same row loading: the bars have the length of the values and the badge and button their own boxes.

Laura Méndezlaura@northwind.io · since March
Owner
Code
import { Badge, Button, Row, SkeletonOf, SkeletonWords, Stack, Text } from '@sypnia/ui/react';

// Inside the real piece, the values that are not here yet: SkeletonWords draws a bar as long as a typical value, in the
// same line; SkeletonOf draws a real Button or Badge as a skeleton of its own box. The page around them is the real one.
export default function Words() {
  const row = (loading: boolean) => (
    <Row gap={3} justify="between">
      <Stack gap={1}>
        <b>{loading ? <SkeletonWords>Laura Méndez</SkeletonWords> : 'Laura Méndez'}</b>
        <Text as="span" size="sm" tone="muted">{loading ? <SkeletonWords>laura@northwind.io · since March</SkeletonWords> : 'laura@northwind.io · since March'}</Text>
      </Stack>
      <Row gap={2}>
        {loading ? <SkeletonOf><Badge tone="light">Owner</Badge></SkeletonOf> : <Badge tone="light">Owner</Badge>}
        {loading ? <SkeletonOf><Button size="sm">Resend</Button></SkeletonOf> : <Button size="sm">Resend</Button>}
      </Row>
    </Row>
  );
  return <Stack gap={5}>{row(false)}<div aria-busy="true">{row(true)}</div></Stack>;
}

Pieces that load in their real shape

Stat, Identity, KeyValue, UsageBar, PlanCard, ListItem, ActivityFeed and Pagination take loading with the last values known: names stay, values are bars as long as theirs, buttons wait in their boxes. Press the button to switch.

Requests
Errors

Account

Plan
Region
Seats

Code
import { useState } from 'react';
import {
  ActivityFeed, Button, Columns, Identity, KeyValue, List, ListItem, Pagination, Panel, PlanCard, Stack, Stat, StatGroup, UsageBar,
} from '@sypnia/ui/react';

// Pieces that load in their real shape: give them `loading` and the last values you know (or typical ones). Names and
// labels stay; each value is a bar as long as its own, each button a skeleton of its box. Press the button to switch.
export default function Pieces() {
  const [loading, setLoading] = useState(true);
  return (
    <Stack gap={4}>
      <div><Button icon="refresh" onClick={() => setLoading((l) => !l)}>{loading ? 'Show the values' : 'Load again'}</Button></div>
      <div aria-busy={loading}>
        <Stack gap={4}>
          <StatGroup><Stat loading={loading} label="Requests" value="880K" delta="+12% this week" trend="good" /><Stat loading={loading} label="Errors" value="0.82%" /></StatGroup>
          <Columns cols={2} stack>
            <Panel title="Account">
              <Stack gap={4}>
                <Identity loading={loading} name="Ana Ruiz" meta="ana@northwind.io" />
                <KeyValue loading={loading} items={[['Plan', 'Team'], ['Region', 'São Paulo']]} />
                <UsageBar loading={loading} label="Seats" used={5} limit={8} />
              </Stack>
            </Panel>
            <PlanCard loading={loading} name="Pro" price={29} currency="USD" period="month" blurb="For a product in production." action={<Button>Change plan</Button>} />
          </Columns>
          <List label="Customers">
            <ListItem loading={loading} title="Luis Ortega" description="Lumen Labs" meta="2 orders" />
            <ListItem loading={loading} title="Marta Gil" description="Globex" meta="11 orders" />
          </List>
          <ActivityFeed label="Activity" loading={loading} items={[{ id: 1, actor: { name: 'Ana Ruiz' }, action: 'deployed', target: 'version 1.42', time: Date.UTC(2026, 10, 17, 13) }]} />
          <Pagination loading={loading} page={1} pageSize={20} total={86} onPage={() => undefined} />
        </Stack>
      </div>
    </Stack>
  );
}

Cards on their way

The grid is already in place.

Code
import { Skeleton } from '@sypnia/ui/react';

// A page of cards that is on its way.
export default function Cards() {
  return (
    <div className="sy-grid" aria-busy="true">
      {[0, 1, 2].map((i) => (
        <div key={i} className="sy-card">
          <Skeleton width="55%" height={18} />
          <Skeleton width="80%" />
          <Skeleton width={72} height={22} />
        </div>
      ))}
    </div>
  );
}

When to use it

Use it when

  • Content is loading and you know its shape: a row, a card, an avatar.
  • Build the skeleton from the same layout as the real thing, so it fits exactly: the real page, its real headers, panels and columns, and only the values as skeletons.
  • A value inside a real piece: SkeletonWords with a typical value, so the bar has the value's length and line. A Button or Badge whose words are known: SkeletonOf.
  • This is the only way Sypnia shows loading: there are no spinners and no «Loading…».

Do not use it when

  • It is text of several lines: SkeletonText.
  • A button is working: the button has its own busy state.
  • It is a known amount of work (an import, an upload): Progress shows how much is left.
  • The answer takes less than a moment: showing nothing is calmer than a flash of grey.

For everyone

  • Skeletons are hidden from screen readers. Mark the region around them with aria-busy="true"; add aria-live="polite" so the content is announced when it arrives.
  • The shimmer stops for people who ask their device for less motion.
  • Nothing inside a loading region takes focus.

Props

SkeletonTypeDefault
circle boolean
className string
height string | number
radius string | number
width string | number
  1. Shapes
  2. A list that loads
  3. Words and pieces
  4. Pieces that load in their real shape
  5. Cards on their way
  6. When to use it
  7. For everyone
  8. Props

    Search pages, sections and terms