Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Data display

Skeleton

Grey placeholder shown while content loads.

import { Skeleton } from "@stylhero/ui";

Example

Code
import { Skeleton, Stack } from "@stylhero/ui";

function SkeletonExample() {
  return (
    <Stack direction="row" gap={3} align="center">
      <Skeleton variant="circle" width={48} height={48} />
      <div style={{ flex: 1 }}><Skeleton lines={3} /></div>
    </Stack>
  );
}

Props

PropTypeDefaultDescription
height CSSProperties["height"] -
lines number 1 For text: number of lines (the last one is shorter).
variant "text" | "rect" | "circle" "text"
width CSSProperties["width"] -

Also takes every <span> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Accessibility

  • Hidden from screen readers (aria-hidden); announce loading elsewhere, e.g. with aria-busy on the region.

Generated from src/components/Skeleton.tsx. Something wrong or missing? Open an issue.