react-native-exact-ratio
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-native-exact-ratio

Get exact device density and ppi for React Native.

React Native build-in PixelRatio can get device density using PixelRatio.get(), but the return value has been rounded. This package will return the exact value of device density

Installation

npm install --save react-native-exact-ratio

Usage

import { DeviceRatio } from 'react-native-exact-ratio'

console.log('Device Density:', DeviceRatio.density)
console.log('Device DPI:', DeviceRatio.dpi)

Example

cd example
npm install && cd ios && pod install && cd ..
react-native run-ios

ExampleImage

MIT Licensed

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i react-native-exact-ratio

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    22.2 kB

    Total Files

    20

    Last publish

    Collaborators

    • khuongnb