Particle Logo

Next.js (App Router)에 파티클 로고 애니메이션 추가하기

Next.js는 기본이 서버 컴포넌트이므로 Canvas 기반 파티클 컴포넌트는 클라이언트 선언을 추가하거나 ssr: false로 불러오면 됩니다.

업데이트:

1. React 컴포넌트 내보내기

작업실에서 로고를 올리고 16가지 이펙트 중 하나를 고른 뒤 React 탭에서 PixelLogoLoader.tsx를 내려받으세요(Pro 플랜).

2. Client Component로 지정하기

src/components/PixelLogoLoader.tsx 파일 첫 줄에 'use client';를 추가해 클라이언트 컴포넌트로 렌더링합니다:

'use client';

import { PixelLogoLoader } from '@/components/PixelLogoLoader';

export function HeroLogo() {
  return (
    <div style={{ width: '100%', maxWidth: 420, margin: '0 auto' }}>
      <PixelLogoLoader
        variant="mobius-flow"
        height={320}
        duration={3.2}
        interactive
      />
    </div>
  );
}

3. SSR 중 CLS(레이아웃 이동) 방지

next/dynamic의 ssr: false와 고정 높이 fallback으로 깔끔한 플레이스홀더를 유지할 수 있습니다:

import dynamic from 'next/dynamic';

const PixelLogoLoader = dynamic(
  () => import('@/components/PixelLogoLoader').then((m) => m.PixelLogoLoader),
  { ssr: false, loading: () => <div style={{ height: 320 }} /> }
);

4. 무료 플랜 대안

무료 플랜에서는 HTML5 파일을 public/logo-loader.html에 넣고 <iframe>으로 임베드할 수 있습니다. 전체 속성은 React 가이드를 참고하세요.

워크벤치 열기

다른 가이드