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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    3
  • 1.0.0
    1

Package Sidebar

Install

npm i react-native-exact-ratio

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

22.2 kB

Total Files

20

Last publish

Collaborators

  • khuongnb