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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@moeenshah/react-native-figma-scale

v1.0.7

Published

A simple scaling utility for pixel-perfect React Native designs based on Figma dimensions.

Downloads

492

Readme

moeenshah/react-native-figma-scale

npm version npm downloads License: MIT

A lightweight React Native scaling utility to create pixel-perfect layouts across all devices — using your Figma frame dimensions as the base reference.

Perfect for React Native designers and developers who want design-accurate, responsive UIs without manual adjustments for every screen size.


✨ Features

  • Pixel-perfect scaling from your Figma base width & height
  • ✅ Supports horizontal, vertical, and moderate scaling
  • ✅ Simple one-time configuration
  • ✅ Works on iOS & Android
  • ✅ Zero dependencies — tiny footprint
  • ✅ Designed for React Native 0.69+

📦 Installation

npm install @moeenshah/react-native-figma-scale

or with yarn:

yarn add @moeenshah/react-native-figma-scale

⚙️ Setup

Initialize it once in your app (for example, in App.js):

import { configureScaling } from '@moeenshah/react-native-figma-scale';

configureScaling({ baseWidth: 428, baseHeight: 926 }); // your Figma frame dimensions

🚀 Usage

import { scale, verticalScale, moderateScale } from '@moeenshah/react-native-figma-scale';
import { StyleSheet, View, Text } from 'react-native';

const styles = StyleSheet.create({
  button: {
    width: scale(200),
    height: verticalScale(60),
    borderRadius: moderateScale(12),
    backgroundColor: '#007AFF',
    alignItems: 'center',
    justifyContent: 'center',
  },
  text: {
    fontSize: moderateScale(16),
    color: 'white',
  },
});

export default function App() {
  return (
    <View style={styles.button}>
      <Text style={styles.text}>Pixel Perfect!</Text>
    </View>
  );
}

When you design in Figma with a frame size (e.g. 428×926), this ensures elements scale proportionally across any screen.


🧠 API Reference

| Function | Description | Example | | --------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------- | | configureScaling({ baseWidth, baseHeight }) | Configure your Figma base frame dimensions | configureScaling({ baseWidth: 430, baseHeight: 932 }) | | scale(size) | Scales horizontally based on screen width | width: scale(200) | | verticalScale(size) | Scales vertically based on screen height | height: verticalScale(60) | | moderateScale(size, factor?) | Smooth horizontal scaling with a moderation factor (default 0.5) | fontSize: moderateScale(16) | | moderateVerticalScale(size, factor?) | Smooth vertical scaling | marginTop: moderateVerticalScale(20) |


📋 Example Configuration

Figma Frame: 428 × 926 Usage Example:

configureScaling({ baseWidth: 428, baseHeight: 926 });
const styles = {
  title: { fontSize: moderateScale(20) },
  box: { width: scale(300), height: verticalScale(150) },
};

✅ Works perfectly across devices:

  • iPhone 13 / 14 / 15
  • Android mid-range phones
  • Tablets (with proportional scaling)

🔧 Notes

  • Uses React Native’s Dimensions.get('window') internally.
  • Automatically adapts to orientation changes.
  • Ideal for maintaining consistent spacing, sizing, and typography across devices.

🤝 Contributing

Contributions are welcome! 🎉

  1. Fork the repo
  2. Create a new branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Run npm run build to compile
  5. Submit a PR 🚀

📜 License

MIT © 2025 Moeen Shah