Skeleton
Shimmering placeholder that matches the layout it replaces.
Code
import * as React from 'react';
import { Skeleton } from '@fruit-labs/design';
export default function Demo() {
return (
<div
aria-busy="true"
style={{
display: 'flex',
gap: 12,
alignItems: 'center',
maxWidth: 380,
}}
>
<Skeleton width={40} height={40} circle />
<div
style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
gap: 8,
}}
>
<Skeleton width="60%" />
<Skeleton width="90%" height={10} />
</div>
</div>
);
}A loading row
import { Skeleton } from '@fruit-labs/design';
export default function Example() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 12, alignItems: 'center' }}>
<Skeleton circle width={40} height={40} />
<Skeleton width="60%" height={14} />
<Skeleton width="40%" height={14} />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Skeleton } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/skeleton.jsonGuidelines
- Match real sizes so content doesn't jump. Mark the region aria-busy.
Props
| Prop | Type | Required |
|---|---|---|
width | number | string | No |
height | number | string | No |
circle | boolean | No |
radius | number | string | No |
className | string | No |
style | React.CSSProperties | No |