Skip to main content

Skeleton

A placeholder that mimics the shape of content while it loads. Skeleton.Button and Skeleton.Node are preset shapes for common cases.

import { Skeleton } from '@jbpark/ui-kit';

<Skeleton loading={isLoading} avatar count={3}>
<RealContent />
</Skeleton>;

Props

PropTypeDefault
loadingbooleantrue
activebooleantrue
avatarboolean-
size'small' | 'default' | 'large''default'
countnumber1
gapnumber6
direction'horizontal' | 'vertical''vertical'
widthstring | number | (string | number)[]-
heightstring | number | (string | number)[]-
classNames{ wrapper?, avatar?, item?: string }-
childrenReactNode-

When loading is false, children renders as-is (no wrapper). active toggles the shimmer animation. width/height accept an array to size each of the count placeholder items individually. Skeleton also accepts the rest of React.ComponentPropsWithoutRef<'div'>.

Skeleton.Button and Skeleton.Node accept the same props (minus their own preset shape) as shortcuts for a button-sized and a large card-sized placeholder, respectively.