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

responsive-csx

v1.0.8

Published

Powerful responsive UI toolkit for React Native, delivering scalable designs across devices with ease.

Readme

responsive-csx

✨ Features

  • 📏 Smart scaling: width, height, and font scaling tailored to device types
  • 🔁 Live device orientation and dimension detection with a hook
  • 🔍 Device awareness: phone/tablet detection, notch presence, aspect ratios
  • ⚖️ Moderated scaling with factor customization
  • 🧠 Intelligent font scaling with accessibility support
  • ⚡ Minimal dependencies, plug-and-play setup

📦 Installation

npm install responsive-csx


yarn add responsive-csx


pnpm add responsive-csx

🔧 Usage

The rs object provides quick access to commonly used utilities:

📏 Scaling functions:

| Function | Description | Equivalent import | | --------- | ----------------------------------------- | ----------------- | | rs.s() | Width-based scale (padding, margin, etc.) | scale() | | rs.vs() | Height-based scale (vertical spacing) | verticalScale() | | rs.ms() | Moderated scale with customizable factor | moderateScale() | | rs.fs() | Font scaling based on screen/pixel ratio | scaleFontSize() |

import { rs } from 'responsive-csx';

const styles = StyleSheet.create({
  container: {
    padding: rs.s(16),       // Width-based scaling
    marginVertical: rs.vs(8), // Height-based scaling
  },
  title: {
    fontSize: rs.fs(18),     // Font scaling
  },
});

🔒 Clamp Options

Each function supports optional clamp:

rs.s(16, { min: 12 });           // Clamp only min
rs.s(16, { max: 20 });           // Clamp only max
rs.s(16, { min: 12, max: 20 });  // Clamp both ends

rs.fs(18, { min: 14 });          // Safe minimum font size
rs.ms(22, { max: 26 });          // Moderated with upper bound

✔️ You can pass clamp as the second parameter to restrict the result within a range:

rs.s(value, {
  min?: number,
  max?: number,
});

📱 Device info:

rs.device

| Property | Description | | --------------- | -------------------------------- | | screenWidth | Current screen width (dp) | | screenHeight | Current screen height (dp) | | isTablet | Whether the device is a tablet | | aspectRatio | Screen aspect ratio | | isSmallDevice | Is width ≤ 360 | | baseUnit | Internal base unit based on type | | deviceType | 'phone' | 'tablet' | 'unknown' |

import { rs } from 'responsive-csx';

if (rs.device.isTablet) {
  console.log('Tablet detected!');
}

🔁 Hooks:

| Hook | Description | | -------------------- | ------------------------------------------------------- | | rs.useDimensions() | React hook to get responsive dimensions and orientation |

import { rs } from 'responsive-csx';

const ResponsiveComponent = () => {
  const { isLandscape, screenHeight } = rs.useDimensions();

  return (
    <View style={{ padding: rs.s(10) }}>
      <Text style={{ fontSize: rs.fs(16) }}>
        Orientation: {isLandscape ? 'Landscape' : 'Portrait'} – Height: {screenHeight}
      </Text>
    </View>
  );
};

🧪 Device Internals

Behind the scenes, we calculate:

  • 📐 Aspect ratio
  • 📏 Diagonal inches
  • 📱 Type (small/large phone or tablet)
  • 🎯 Base unit per device
  • 📊 Pixel & font scaling

📜 License

MIT © KJ-GM