Christmas snowfall for React, Next.js and Vue

Christmas Lights is framework-free: one async script that draws on its own canvas overlay. It doesn't touch your component tree or CSS, so it works the same in React, Next.js, Vue, Svelte, Angular or a static site, and you can control it from code.

Free · one line of code · about 3 minutes
You'll need your free key first. It takes a minute and arrives by email.
Get my free code

Step by step

  1. Get your free key

    Register your production domain at worldofaiagents.com/christmas. Keys also work on localhost.

  2. Add the script once

    Use the snippet for your framework below. Load it once per app, not inside components that re-render.

  3. Optional: control it

    window.ChristmasLights has setStyle(), santa(), burst(), celebrate(), on() and off().

Your code looks like this

<script async src="https://worldofaiagents.com/christmas/w.js" data-key="XM-YOURKEY" data-style="wonderland" data-until="2027-01-07"></script>

Change data-style to wonderland, snowfall, lights, sleigh or icicles whenever you like. data-until switches it off after a date (7 January by default). Optional: data-cursor="off" removes the stardust cursor, data-drift="off" stops snow piling up, data-greeting="holidays" says "Happy holidays", and data-position="right" moves the on/off button.

Next.js (App Router)

// app/layout.tsx
import Script from 'next/script';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script src="https://worldofaiagents.com/christmas/w.js" strategy="afterInteractive"
          data-key="XM-YOURKEY" data-style="snowfall" data-until="2027-01-07" />
      </body>
    </html>
  );
}

React (Vite / Create React App)

Paste the script tag into index.html before </body>:

<script async src="https://worldofaiagents.com/christmas/w.js" data-key="XM-YOURKEY" data-style="wonderland" data-until="2027-01-07"></script>

Control it from your app

window.ChristmasLights.setStyle('sleigh');  // wonderland | snowfall | lights | sleigh | icicles
window.ChristmasLights.santa();             // send Santa across the screen, e.g. after checkout
window.ChristmasLights.burst(x, y);         // a snow-globe pop at a screen position
window.ChristmasLights.off();               // and .on()
addEventListener('christmaslights:ready', e => console.log(e.detail.style));

Troubleshooting

It loads twice in development
React Strict Mode double-mounts components. Load the script from your layout or index.html; the widget also ignores a second copy.

Questions

How do I make snow fall in JavaScript?

The quickest way is a ready-made canvas script: add the Christmas Lights script tag and snow falls over your page with wind, interaction and a drift at the bottom, without writing animation code.

Does it work with server-side rendering?

Yes. It runs only in the browser after the page loads, so it has no effect on SSR, hydration or your bundle size.

Let it snow on your website today

The snow on this page is the real widget. Try every theme on the main page.

Get my free Christmas lights 🎄

Other guides