Skeleton Glass
shadcn-glass-ui/skeleton-glassFreeComponent
Glass-themed loading skeleton with:
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/skeleton-glass.jsonSource
1/**2 * SkeletonGlass Component3 *4 * Glass-themed loading skeleton with:5 * - Theme-aware styling (glass/light/aurora)6 * - Shimmer animation7 * - Variant presets (text, title, avatar, thumbnail, card)8 */910import { forwardRef, type CSSProperties } from 'react';11import { type VariantProps } from 'class-variance-authority';12import { cn } from '@/lib/utils';13import { skeletonVariants } from '@/lib/variants/skeleton-glass-variants';14import '@/glass-theme.css';1516// ========================================17// PROPS INTERFACE18// ========================================1920export interface SkeletonGlassProps21 extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {22 readonly width?: string | number;23 readonly height?: string | number;24}2526// ========================================27// COMPONENT28// ========================================2930export const SkeletonGlass = forwardRef<HTMLDivElement, SkeletonGlassProps>(31 ({ className, variant = 'text', width, height, style, ...props }, ref) => {32 const skeletonStyles: CSSProperties = {33 width,34 height,35 background:36 'linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-shine) 50%, var(--skeleton-bg) 75%)',37 backgroundSize: '200% 100%',38 animation: 'skeleton-loading 1.5s infinite',39 ...style,40 };4142 return (43 <div44 ref={ref}45 data-slot="skeleton"46 className={cn(skeletonVariants({ variant }), className)}47 style={skeletonStyles}48 aria-hidden="true"49 {...props}50 />51 );52 }53);5455SkeletonGlass.displayName = 'SkeletonGlass';5657// ========================================58// SHADCN/UI COMPATIBLE ALIAS59// ========================================6061/**62 * Skeleton - shadcn/ui compatible alias for SkeletonGlass63 *64 * @example65 * ```tsx66 * import { Skeleton } from 'shadcn-glass-ui'67 *68 * <Skeleton className="h-4 w-[200px]" />69 * <Skeleton className="h-12 w-12 rounded-full" />70 * ```71 * @since v2.5.072 */73export const Skeleton = SkeletonGlass;
More from shadcn-glass-ui
All 76 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alert Glassalert-glass | shadcn-glass-ui | Components | Free | no deps | |
| Animated Background Glassanimated-background-glass | shadcn-glass-ui | Components | Free | no deps | |
| Avatar Glassavatar-glass | shadcn-glass-ui | Components | Free | no deps | |
| Badge Glassbadge-glass | shadcn-glass-ui | Components | Free | no deps | |
| Base Progress Glassbase-progress-glass | shadcn-glass-ui | Components | Free | no deps | |
| Button Glassbutton-glass | shadcn-glass-ui | Components | Free | no deps | |
| Card Glasscard-glass | shadcn-glass-ui | Components | Free | no deps | |
| Checkbox Glasscheckbox-glass | shadcn-glass-ui | Components | Free | no deps |
