https://github.com/jskits/react-native-px2dp
Pixels convert to density-independent pixels.
https://github.com/jskits/react-native-px2dp
react-native
Last synced: 13 days ago
JSON representation
Pixels convert to density-independent pixels.
- Host: GitHub
- URL: https://github.com/jskits/react-native-px2dp
- Owner: unadlib
- License: mit
- Created: 2017-04-18T06:54:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-20T03:15:41.000Z (about 9 years ago)
- Last Synced: 2025-04-15T03:17:56.237Z (about 1 year ago)
- Topics: react-native
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 22
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-px2dp
pixels convert to density-independent pixels.
### Default UI Size
Default UI design size is based on 1280x720.
### Installation
```bash
npm install react-native-px2dp --save
```
### Usage
```javascript
import px,{px2dp} from 'react-native-px2dp';
const style = {
width: 720 * px,//UI height size is 1280.
}
const otherStyle = {
width: 720 * px2dp(480),//UI height size is 960.
}
```