FeedbackNew
Glass Skeleton
A glass placeholder block, circle or set of text lines shown while content loads.
Preview
Demos ready. Update 0.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-skeletonAdds 5 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassSkeleton } from "@/components/glassyui/glass-skeleton";
export function LoadingProfile() {
return (
<div aria-busy="true">
<GlassSkeleton variant="circle" />
<GlassSkeleton variant="text" lines={2} />
</div>
);
}React Native usage
import { View } from 'react-native';
import { GlassSkeleton } from '@/components/glassyui/glass-skeleton';
export default function SkeletonExample() {
return (
<View style={{ flexDirection: 'row', gap: 12 }}>
<GlassSkeleton variant="circle" />
<View style={{ flex: 1, gap: 8 }}>
<GlassSkeleton style={{ height: 16, width: '60%' }} />
<GlassSkeleton lines={2} variant="text" />
</View>
</View>
);
}
Examples
Size a block with CSS
<GlassSkeleton style={{ height: 120, borderRadius: 20 }} />API reference
GlassSkeleton
A div hidden from assistive technology with aria-hidden.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'block' | 'circle' | 'text' | 'block' | block is sized with CSS, circle is a 2.5rem circle you can resize with width, and text is a stack of lines. |
lines | number | 3 | Line count for the text variant, at least 1; the last of several lines is shorter. |
Also accepts HTML div attributes, except children.
- Types
GlassSkeletonPropsGlassSkeletonVariant- Accessibility
- Skeletons are aria-hidden, so set aria-busy on the region that is loading.
The React Native props and exports are in the component’s source.