View as Markdown

API reference: @salmonui/notifications/skeleton

Skeletoncomponent

import { Skeleton } from '@salmonui/notifications/skeleton';
function Skeleton({ shape, lines, width, height, animation, loading, children, className, style, ref, ...rest }: SkeletonProps): ReactNode;

A placeholder shape shown while content loads.

Props: SkeletonProps

Skeleton props (8)
NameSignatureDescription
shapeoptionalshape?: SkeletonShape;

'text' (default, a line of text height), 'circle' or 'rect'.

linesoptionallines?: number;

Text lines (shape="text"); the last of several lines is shorter.

widthoptionalwidth?: number | string;

Inline size: a number of pixels or any CSS length.

heightoptionalheight?: number | string;

Block size: a number of pixels or any CSS length.

animationoptionalanimation?: SkeletonAnimation;

'wave' (default, the transform-only shimmer shared with the Data Grid skeleton rows), 'pulse' (opacity) or false (static). Every animation stops under prefers-reduced-motion.

loadingoptionalloading?: boolean;

Shows the placeholder (default true). With children, loading={false} renders only the children and loading sizes the placeholder from them while they are hidden and inert.

childrenoptionalchildren?: ReactNode;

Content the placeholder stands in for.

refoptionalref?: Ref<HTMLSpanElement>;

The root <span>.