<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: hdcode dev</title>
    <description>The latest articles on Forem by hdcode dev (@hdcodedev).</description>
    <link>https://forem.com/hdcodedev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3675781%2F7e23815c-a606-40d6-8fba-d6a277795106.png</url>
      <title>Forem: hdcode dev</title>
      <link>https://forem.com/hdcodedev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hdcodedev"/>
    <language>en</language>
    <item>
      <title>A React Snowfall Effect with Physics</title>
      <dc:creator>hdcode dev</dc:creator>
      <pubDate>Tue, 23 Dec 2025 20:52:07 +0000</pubDate>
      <link>https://forem.com/hdcodedev/a-react-snowfall-effect-with-physics-1ia7</link>
      <guid>https://forem.com/hdcodedev/a-react-snowfall-effect-with-physics-1ia7</guid>
      <description>&lt;p&gt;I released an open-source library called &lt;strong&gt;&lt;a href="https://github.com/hdcodedev/snowfall" rel="noopener noreferrer"&gt;@hdcodedev/snowfall&lt;/a&gt;&lt;/strong&gt;. It adds a snowfall effect to React applications where the snow interacts with the page content.&lt;/p&gt;

&lt;p&gt;Most snowfall effects just overlay the screen. This one uses physics so the snowflakes actually land and accumulate on your HTML elements (headers, cards, buttons, etc.).&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Physics&lt;/strong&gt;: Wind, gravity, and collision detection.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Accumulation&lt;/strong&gt;: Snow piles up on elements and eventually melts.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Smart Detection&lt;/strong&gt;: You can use &lt;code&gt;data-snowfall&lt;/code&gt; attributes or let it auto-detect semantic tags.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s easy to drop into a project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @hdcodedev/snowfall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Snowfall&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SnowfallProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@hdcodedev/snowfall&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SnowfallProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Snowfall&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Snow will accumulate on this element */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Winter Mode&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;header&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;SnowfallProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The source code and docs are on GitHub:&lt;br&gt;
&lt;strong&gt;&lt;a href="https://github.com/hdcodedev/snowfall" rel="noopener noreferrer"&gt;github.com/hdcodedev/snowfall&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Live demo:&lt;br&gt;
&lt;a href="https://next-snowfall.vercel.app" rel="noopener noreferrer"&gt;next-snowfall.vercel.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
