npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

geodigitus-scaling-layout

v1.0.0

Published

Scaling layout utilities with React support

Readme

Scaling Layout

Biblioteca interna para criar layouts responsivos baseados no scaling do SO e breakpoints customizados, totalmente compatível com TailwindCSS.

Ela detecta:

  • Scaling do sistema (base, s125, s150)
  • Breakpoint da janela (tiny, small, medium, large, huge)

Isso permite criar tipografia, espaçamentos, padding e cores adaptativos sem lógica extra de JavaScript.


Instalação

Como é uma biblioteca interna, basta instalar no seu workspace:

pnpm add scaling-layout
# ou
npm install scaling-layout

Uso básico com React + Tailwind

import { useScalingLayout } from 'scaling-layout/react';
import { clsx } from 'clsx';

export default function ScalingTest() {
  const { scaling, breakpoint } = useScalingLayout({
    breakpoints: {
      tiny: 320,
      small: 450,
      medium: 768,
      large: 1170,
      huge: 1440,
    },
  });

  return (
    <div className="min-h-screen p-8 bg-gray-100">
      {/* Header com informações */}
      <div className="max-w-6xl mx-auto mb-8 p-6 bg-white rounded-lg shadow-lg">
        <h1 className="text-3xl font-bold mb-4 text-gray-800">
          🔍 Scaling Layout – Playground
        </h1>

        <div className="grid grid-cols-2 gap-4">
          <div className="p-4 bg-blue-50 rounded">
            <p className="text-sm text-gray-600">Scaling (SO)</p>
            <p className="text-2xl font-bold text-blue-600">{scaling}</p>
          </div>

          <div className="p-4 bg-purple-50 rounded">
            <p className="text-sm text-gray-600">Breakpoint</p>
            <p className="text-2xl font-bold text-purple-600">{breakpoint}</p>
          </div>
        </div>
      </div>

      {/* Cards de exemplo */}
      <div className="max-w-6xl mx-auto grid grid-cols-1 gap-6 bp-medium:grid-cols-2 bp-large:grid-cols-3">
        <div
          className={clsx(
            'rounded-xl shadow-lg transition-all p-8',
            scaling === 'base' && 'bg-blue-500',
            scaling === 's125' && 'bg-yellow-500 w-3/4',
            scaling === 's150' && 'bg-red-500 w-2/3',
          )}
        >
          <h2 className="text-os font-bold text-white mb-4">Scaling (SO)</h2>
          <ul className="text-white space-y-2">
            <li>🟦 Base (100%)</li>
            <li>🟨 125%</li>
            <li>🟥 150%</li>
          </ul>
        </div>

        <div
          className={clsx(
            'p-8 rounded-xl shadow-lg transition-all bg-gray-500',
            breakpoint === 'tiny' && 'bg-gray-400',
            breakpoint === 'small' && 'bg-pink-500',
            breakpoint === 'medium' && 'bg-purple-500',
            breakpoint === 'large' && 'bg-indigo-500',
            breakpoint === 'huge' && 'bg-cyan-500',
          )}
        >
          <h2 className="text-2xl font-bold text-white mb-4">Breakpoints</h2>
          <p className="text-white">A cor muda conforme a largura da janela.</p>
        </div>
      </div>

      {/* Instruções */}
      <div className="max-w-6xl mx-auto mt-10 p-6 bg-yellow-50 border-2 border-yellow-300 rounded-lg">
        <h3 className="text-xl font-bold text-yellow-800 mb-2">📋 Como testar</h3>
        <ul className="text-yellow-900 space-y-2">
          <li>✅ Mude o scaling do Windows (100%, 125%, 150%)</li>
          <li>✅ Redimensione a janela do navegador</li>
          <li>✅ Nenhuma lógica JS controla o layout</li>
        </ul>
      </div>
    </div>
  );
}

API

useScalingLayout(config?)

const { scaling, breakpoint } = useScalingLayout({
  breakpoints: {
    tiny?: number,
    small?: number,
    medium?: number,
    large?: number,
    huge?: number,
  },
});
  • scaling'base' | 's125' | 's150'
  • breakpoint'tiny' | 'small' | 'medium' | 'large' | 'huge' | null
  • breakpoints → define os limites de largura para cada bucket

Funciona especialmente bem com Tailwind + clsx, para trocar estilos dinamicamente.


Exemplo visual de fluxo

+-------------------------------------------+
| Windows Scaling                           |
|                                           |
| base   -> 100%                            |
| s125   -> 125%                            |
| s150   -> 150%                            |
+-------------------------------------------+

+-------------------------------------------+
| Breakpoints (width)                       |
|                                           |
| tiny   -> 320px                            |
| small  -> 450px                            |
| medium -> 768px                            |
| large  -> 1170px                           |
| huge   -> 1440px                           |
+-------------------------------------------+

Quando combinados, você consegue controlar:
- Tipografia adaptativa
- Padding responsivo
- Cores e backgrounds dinâmicos
- Layouts com múltiplos breakpoints e scaling

Exemplo avançado com Tailwind + clsx

<div
  className={clsx(
    'p-8 rounded-xl shadow-lg transition-all',
    scaling === 's125' && breakpoint === 'medium' && 'bg-orange-500',
    scaling === 's150' && breakpoint === 'large' && 'bg-amber-500',
  )}
>
  Scaling + Breakpoint ao mesmo tempo
</div>
  • Permite criar tipografia, padding, cores e layouts adaptativos com múltiplos níveis de responsividade.
  • Mantém seu layout limpo sem lógica adicional de JS.

Observações

  • Biblioteca interna, focada em TailwindCSS.
  • Não conflita com breakpoints nativos do Tailwind (sm, md, lg, xl, 2xl).
  • Flexível e escalável para futuros aj