You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-adapt-screen

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-adapt-screen

The index.js file provides utility functions for implementing responsive design in React Native applications. Leveraging the Dimensions and PixelRatio modules from react-native, it offers functions such as SizeShouldBe, WidthShouldBe, and HeightShouldBe t

1.0.18
latest
npmnpm
Version published
Weekly downloads
38
-7.32%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to react-native-adapt-screen 👋

React Native Adapt Screen


Version License: MIT

platform - android platform - ios npm npm


Achieve pixel-perfect UI dimensions and font sizes in your React Native app effortlessly with React Native Adapt Screen. Say goodbye to manual tweaking and ensure your app's UI matches your Figma or Adobe XD designs seamlessly.

Features

  • Pixel-Perfect UI Dimensions: Utilize WidthShouldBe() and HeightShouldBe() functions to set exact dimensions based on your design files.
  • Precise Font Sizing: Set font sizes using SizeShouldBe() for optimal readability and aesthetics.
  • Seamless Integration: Easily integrate with your existing React Native projects.
  • Time-Saving: Eliminate the need for manual adjustments, saving valuable development time.

Version 1.0.18

  • Added Full Width and Full Height props - Now you can easily create full screen

Installation

Install React Native Adapt Screen via npm:

npm install react-native-adapt-screen

Usage

Import the necessary functions from React Native Adapt Screen:

import {
  WidthShouldBe,
  HeightShouldBe,
  SizeShouldBe,
  FullWidth,
  FullHeight,
} from "react-native-adapt-screen";

Use these functions with exact size integers from your Figma or Adobe XD designs:

<View style={{ width: FullWidth(), height: FullHeight() }}>
  <View style={{ width: WidthShouldBe(100), height: HeightShouldBe(200) }}>
    <Text style={{ fontSize: SizeShouldBe(18) }}>
      Hello, React Native Adapt Screen!
    </Text>
  </View>
</View>

Author

👤 Harsh Sharma

Give a ⭐️ if this project helped you!

Keywords

react-native

FAQs

Package last updated on 18 Mar 2024

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