'use client'; import { useState, useEffect } from 'react'; import { useTheme } from 'next-themes'; import Link from 'next/link'; import { Shimmer } from '@shimmer-from-structure/react'; import { Header } from './Header'; import { Footer } from './Footer'; import { NpmDownloadStats } from './NpmDownloadStats'; import { LatestRelease } from './LatestRelease'; import { ShimmerProvider } from '@shimmer-from-structure/react'; import type { Release } from '../../lib/changelog'; interface HomeContentProps { latestRelease: Release; } /** macOS-style terminal window for code example */ function QuickExampleTerminal() { return (
{/* Traffic-light dots */}
{/* Code example */}
          
            
              import{' '}
              {'{ Shimmer }'}{' '}
              from{' '}
              'shimmer-from-structure'
              ;
            
            {'\n\n'}
            
              function{' '}
              UserCard
              () {'{'}
            
            {'\n  '}
            
              return{' '}
              (
            
            {'\n    '}
            
              {'{' '}
              loading
              ={'{'}
              isLoading
              {'}'}
              {'>'}
            
            {'\n      '}
            
              {'{' '}
              className
              =
              "card"
              {'>'}
            
            {'\n        '}
            
              {'{' '}
              src
              =
              "avatar.jpg"{' '}
              className
              =
              "avatar"{' '}
              {'/>'}
            
            {'\n        '}
            
              {'

'} John Doe {'

'}
{'\n '} {'

'} Software Engineer {'

'}
{'\n '} {'
'} {'\n '} {''} {'\n '} ); {'\n'} {'}'}
); } export function HomeContent({ latestRelease }: HomeContentProps) { const [loading, setLoading] = useState(true); const { resolvedTheme } = useTheme(); useEffect(() => { const timer = setTimeout(() => setLoading(false), 3000); return () => clearTimeout(timer); }, []); const handleShowDemo = () => { setLoading(true); setTimeout(() => setLoading(false), 3000); }; const isDark = resolvedTheme === 'dark'; const shimmerColor = isDark ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.1)'; const backgroundColor = isDark ? 'rgba(255, 255, 255, 0.05)' : 'rgba(0, 0, 0, 0.05)'; return (
{/* Demo Button */}
{/* Hero Section */}

Shimmer From Structure

A structure-aware skeleton loader that mirrors your rendered UI at runtime. Zero layout duplication. Built for modern frameworks.

Get Started View Examples GitHub
{/* Framework Badges */}
{['React', 'Vue', 'Svelte', 'Angular', 'SolidJS'].map((fw) => ( {fw} ))}
{/* Features Section */}

Why Shimmer From Structure?

Zero Maintenance

Automatically measures your component's structure at runtime. No need to maintain separate skeleton components.

Auto Border-Radius

Detects border-radius from your CSS automatically. Circular avatars get circular shimmer blocks.

Framework Agnostic

Dedicated adapters for React, Vue, Svelte, Angular, and SolidJS with framework-specific APIs.

Tiny Bundle Size

Core package is only 1.44 kB. Framework adapters range from 3.89 kB to 12.84 kB.

Dynamic Data Support

Use templateProps to provide mock data for components that receive dynamic props.

Dark Mode Friendly

Default colors use semi-transparent whites that work on any background.

{/* NPM Download Stats */}
{/* Latest Release */} {/* Quick Example */}

Quick Example

That's it! No skeleton components to maintain.

); }