🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-native-size-matters

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-size-matters

A React-Native utility belt for scaling the size your apps UI across different sized devices

0.4.2
latest
Source
npm
Version published
Weekly downloads
175K
-0.34%
Maintainers
1
Weekly downloads
 
Created

What is react-native-size-matters?

The react-native-size-matters package provides utility functions to handle scaling of sizes in a React Native application. It helps in making the app responsive across different screen sizes and resolutions.

What are react-native-size-matters's main functionalities?

Scaling Sizes

This feature allows you to scale sizes based on the device's screen size. The `scale`, `verticalScale`, and `moderateScale` functions help in scaling width, height, and other dimensions respectively. The `ScaledSheet` utility allows you to define styles with scaling directly in the stylesheet.

import { ScaledSheet, moderateScale, verticalScale, scale } from 'react-native-size-matters';

const styles = ScaledSheet.create({
  container: {
    width: '100@s', // scales the width
    height: '50@vs', // scales the height vertically
    padding: '10@ms', // scales the padding moderately
  },
});

const scaledWidth = scale(100);
const scaledHeight = verticalScale(50);
const scaledPadding = moderateScale(10);

ScaledSheet

The `ScaledSheet` utility allows you to create stylesheets where you can use scaling directly in the style definitions. This makes it easier to maintain and apply consistent scaling across your application.

import { ScaledSheet } from 'react-native-size-matters';

const styles = ScaledSheet.create({
  container: {
    width: '100@s',
    height: '50@vs',
    padding: '10@ms',
  },
  text: {
    fontSize: '14@ms',
  },
});

Other packages similar to react-native-size-matters

Keywords

javascript

FAQs

Package last updated on 03 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts