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

react-native-screen-responsive

v1.0.0

Published

A utility library for responsive layouts in React Native.

Readme

react-native-screen-responsive

A lightweight utility library for responsive layouts in React Native that handles device-specific adjustments, including support for both Android and iOS. It also provides optimized scaling for tablets and different screen sizes, ensuring your app works seamlessly across all devices.

Installation

To install the package, run:

npm install react-native-screen-responsive

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { scale, fullWidth, fullHeight } from 'react-native-screen-responsive';

const App = () => {
  return (
    <View style={styles.container}>
      <Text style={styles.title}>Responsive Layout</Text>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    paddingHorizontal: scale(20), // Scales based on width
    marginBottom: scale(16, 'height'), // Scales based on height
  },
  title: {
    fontSize: scale(24, 'font'), // Scales font size
  },
});

export default App;

API
scale(size, type = 'width'): Scales a value based on the device dimensions (width, height, or font size).

Parameters:
size (number): The value to scale (e.g., padding, margin, font size).
type (string, optional): The scaling type (default is width, can also be height or font).
Returns: The scaled value.
fullWidth: The device's full screen width in pixels.

fullHeight: The device's full screen height in pixels.

heightRef: The reference ratio for height scaling (based on a default device).

widthRef: The reference ratio for width scaling (based on a default device).

fontRef: The reference ratio for font scaling (based on a default device).

Responsive Design for Android, iOS, and Tablets
This library provides automatic scaling for both Android and iOS devices. The scaling logic adjusts the layout based on screen size, resolution, and device orientation.

Smart Scaling: The package automatically scales elements like padding, margins, and font sizes based on device dimensions.
Tablet Responsiveness: It offers enhanced scaling support for tablets and larger screens by using a default reference size (like the iPhone 13 Pro Max dimensions) for consistent scaling across all screen sizes.
Tablet and Large Screen Support
On larger devices like tablets, this package ensures that your app’s layout maintains its integrity by adjusting spacing and text sizes proportionally.
You can also customize the scaling logic by tweaking the reference dimensions if needed.
Why Use This Package?
Cross-Platform Support: Fully supports both iOS and Android devices.
Responsive Design: Automatically adapts layouts for phones, tablets, and different screen sizes.
Lightweight: Minimal overhead for your app while providing essential layout utilities.
Easy Integration: Just import the utility and start scaling your layouts.
Installation Notes
This package works out of the box for most devices, but you can customize the reference dimensions and scaling factors by modifying the core values in the index.js file.
Ensure that your React Native project is up-to-date to avoid compatibility issues.
Contributing
Contributions are welcome! If you
d like to improve this package, feel free to fork the repository and submit a pull request.

License
 MIT License. See LICENSE for more information.


---

### Explanation of the Sections:
- **Installation**: Instructions for installing your package via npm.
- **Usage**: Example code on how to integrate the `react-native-screen-responsive` package into a React Native project, demonstrating how to use the `scale()` function for scaling values.
- **API**: Details on the available functions and constants.
- **Responsive Design**: Explains how the package handles device and tablet-specific responsiveness.
- **Tablet Support**: Emphasizes the tablet handling, ensuring your app remains consistent on larger screens.
- **Contributing**: Encourages others to contribute to the development of the package.
- **License**: Mentions the MIT license (you can modify this if needed).

---