<?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>DEV Community: hwan</title>
    <description>The latest articles on DEV Community by hwan (@justicehwan).</description>
    <link>https://dev.to/justicehwan</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4259892%2F33c84d28-81dd-401d-ac9c-b4a09abfd0fd.jpg</url>
      <title>DEV Community: hwan</title>
      <link>https://dev.to/justicehwan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/justicehwan"/>
    <language>en</language>
    <item>
      <title>I made my first npm library: scrollbars that don't shove your layout around 🙏</title>
      <dc:creator>hwan</dc:creator>
      <pubDate>Mon, 23 Nov 2026 06:48:09 +0000</pubDate>
      <link>https://dev.to/justicehwan/i-made-my-first-npm-library-scrollbars-that-dont-shove-your-layout-around-4b39</link>
      <guid>https://dev.to/justicehwan/i-made-my-first-npm-library-scrollbars-that-dont-shove-your-layout-around-4b39</guid>
      <description>&lt;p&gt;Hey everyone 👋&lt;/p&gt;

&lt;p&gt;You know when a list gets one item longer, a scrollbar pops in, and everything jumps a few pixels to the left? Buttons move, text re-wraps, centered stuff is suddenly off-center.&lt;/p&gt;

&lt;p&gt;That annoyed me enough that I made a little library for it. It's my first one ever.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffoo32prgig023z095t8a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffoo32prgig023z095t8a.gif" alt="Before: content shifts when the scrollbar appears. After: nothing moves." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  One line, that's it
&lt;/h2&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="nc"&gt;MrScroll&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"plz-mr-scroll/react"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MrScroll&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put it at the root of your app. You don't add anything to your components.&lt;/p&gt;

&lt;p&gt;Not using React? &lt;code&gt;installMrScroll()&lt;/code&gt; from &lt;code&gt;plz-mr-scroll&lt;/code&gt; does the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it actually does
&lt;/h2&gt;

&lt;p&gt;It finds every scroll area on the page and gives the scrollbar a spot that doesn't move your content:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The area has enough right padding → it shrinks that padding by the scrollbar width&lt;/li&gt;
&lt;li&gt;The content is centered → it balances both sides so the center stays put&lt;/li&gt;
&lt;li&gt;The padding is on the parent → it floats the scrollbar just outside the area&lt;/li&gt;
&lt;li&gt;No room anywhere → it floats the scrollbar over the edge of the content&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No reserved gutter, and it's still the native scrollbar — not a custom-drawn one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0zdq2u892e1d8ug5udgy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0zdq2u892e1d8ug5udgy.gif" alt="The scrollbar floats into the sidebar's padding instead of pushing the list." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;👉 Live demo: &lt;a href="https://justicehwan.github.io/plz-mr-scroll/" rel="noopener noreferrer"&gt;https://justicehwan.github.io/plz-mr-scroll/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/justicehwan/plz-mr-scroll" rel="noopener noreferrer"&gt;https://github.com/justicehwan/plz-mr-scroll&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/plz-mr-scroll" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/plz-mr-scroll&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Please tell me what's wrong with it 🥲
&lt;/h2&gt;

&lt;p&gt;Since it's my first library, I honestly have no idea what I got wrong. If you have a minute, please try the demo and tell me what's broken, confusing, or just dumb.&lt;/p&gt;

&lt;p&gt;P.S. I'm Korean and English isn't my first language, so sorry if anything here reads a bit off.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>css</category>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
