{"id":21768266,"url":"https://github.com/hoaphantn7604/react-native-utils-scale","last_synced_at":"2025-08-30T20:15:27.429Z","repository":{"id":44456932,"uuid":"310492499","full_name":"hoaphantn7604/react-native-utils-scale","owner":"hoaphantn7604","description":"Provide solutions to make your app flexible for different screen sizes, different devices.","archived":false,"fork":false,"pushed_at":"2022-07-12T06:53:48.000Z","size":3979,"stargazers_count":47,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T04:01:56.623Z","etag":null,"topics":["check-tablet","device-inch","font-scaling","has-notch","react-native","scaling","size-matters"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoaphantn7604.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-06T04:35:57.000Z","updated_at":"2025-02-04T00:43:18.000Z","dependencies_parsed_at":"2022-07-13T08:31:11.475Z","dependency_job_id":null,"html_url":"https://github.com/hoaphantn7604/react-native-utils-scale","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hoaphantn7604/react-native-utils-scale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoaphantn7604%2Freact-native-utils-scale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoaphantn7604%2Freact-native-utils-scale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoaphantn7604%2Freact-native-utils-scale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoaphantn7604%2Freact-native-utils-scale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoaphantn7604","download_url":"https://codeload.github.com/hoaphantn7604/react-native-utils-scale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoaphantn7604%2Freact-native-utils-scale/sbom","scorecard":{"id":467137,"data":{"date":"2025-08-11","repo":{"name":"github.com/hoaphantn7604/react-native-utils-scale","commit":"306e179e9bbf9121610c6263b714440db4b01fa6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: example/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"52 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-f5x2-xv93-4p23","Warn: Project is vulnerable to: GHSA-gmpm-xp43-f7g6","Warn: Project is vulnerable to: GHSA-pf27-929j-9pmm","Warn: Project is vulnerable to: GHSA-327c-qx3v-h673","Warn: Project is vulnerable to: GHSA-x4cf-6jr3-3qvp","Warn: Project is vulnerable to: GHSA-mph8-6787-r8hw","Warn: Project is vulnerable to: GHSA-7mhc-prgv-r3q4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4","Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653","Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj","Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67","Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w","Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2","Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-4w2j-2rg4-5mjw","Warn: Project is vulnerable to: GHSA-mrgp-mrhc-5jrq","Warn: Project is vulnerable to: GHSA-7jxr-cg7f-gpgv","Warn: Project is vulnerable to: GHSA-xj72-wvfv-8985","Warn: Project is vulnerable to: GHSA-ch3r-j5x3-6q2m","Warn: Project is vulnerable to: GHSA-p5gc-c584-jj6v","Warn: Project is vulnerable to: GHSA-whpj-8f3w-67p5","Warn: Project is vulnerable to: GHSA-cchq-frgv-rjh5","Warn: Project is vulnerable to: GHSA-g644-9gfx-q4q4","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T12:50:12.097Z","repository_id":44456932,"created_at":"2025-08-19T12:50:12.097Z","updated_at":"2025-08-19T12:50:12.097Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272900166,"owners_count":25012034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["check-tablet","device-inch","font-scaling","has-notch","react-native","scaling","size-matters"],"created_at":"2024-11-26T13:35:10.097Z","updated_at":"2025-08-30T20:15:27.403Z","avatar_url":"https://github.com/hoaphantn7604.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## react-native-utils-scale\nProvide solutions to make your app flexible for different screen sizes, different devices.\nWhen developing with react-native, you need to manually adjust your app to look great on a variety of different screen sizes.\nThis package provides some simple tooling to make your scaling a whole lot easier.\n\n## Getting started\n\n```js\n  yarn add react-native-utils-scale\n```\nor\n\n```js\n  npm i react-native-utils-scale\n```\n### RN Version \u003c 0.60\n```js\n    react-native link react-native-utils-scale\n```\n### Run IOS\n```js\n    cd ios \u0026\u0026 pod install\n    react-native run-ios\n```\n\n### Run Android\n```js\n    react-native run-android\n```\n\n### Jest setup\n```js\n    jest.mock('react-native-utils-scale', () =\u003e {\n        const UtilsScale = require('react-native-utils-scale/mock');\n        return UtilsScale;\n    });\n```\n\n### Documents\n| API                | Type                 | Description                                                             |\n| ------------------ | -------------------- | ----------------------------------------------------------------------- |\n| scale              | Function             | Will return a linear scaled result of the provided size                 |\n| fontScale          | Function             | Will return a linear scaled result of the font size provided            |\n| deviceInch         | Number               | Inch of device                                                          |\n| hasNotch           | Boolean              | Tells if the device has a notch                                         |\n| isAndroid          | Boolean              | Tells if the device is Android operating system                         |\n| isIOS              | Boolean              | Tells if the device is IOS operating system                             |\n| isSmallDevice      | Boolean              | Tells the device has a screen size smaller than 4.8 inches              |\n| isTablet           | Boolean              | Tells if the device is a tablet                                         |\n| width              | Number               | Screen width                                                            |\n| height             | Number               | Screen height                                                           |\n\n#### Source code demo\n[react-native-template-components](https://github.com/hoaphantn7604/react-native-template-components) A beautiful template for React Native.\n\n### Demo\n\n![](https://github.com/hoaphantn7604/file-upload/blob/master/document/scale/demo.png)\n\n### Usage\n```javascript\n\nimport React from 'react';\nimport {SafeAreaView, ScrollView, StyleSheet, Text, View} from 'react-native';\nimport {\n  fontScale,\n  scale,\n  deviceInch,\n  hasNotch,\n  isAndroid,\n  isIOS,\n  isSmallDevice,\n  isTablet,\n  width,\n  height,\n} from 'react-native-utils-scale';\n\nconst App = () =\u003e {\n  return (\n    \u003cScrollView\u003e\n      \u003cSafeAreaView style={styles.container}\u003e\n        \u003cText style={styles.fontScale}\u003eDevice width: {width}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003eDevice height: {height}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003eDevice inch: {deviceInch}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003e\n          isAndroid: {isAndroid.toString()}\n        \u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003eisIOS: {isIOS.toString()}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003eisTablet: {isTablet.toString()}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003ehasNotch: {hasNotch.toString()}\u003c/Text\u003e\n        \u003cText style={styles.fontScale}\u003e\n          isSmallDevice: {isSmallDevice.toString()}\n        \u003c/Text\u003e\n\n        \u003cView style={[styles.box, styles.scale]}\u003e\n          \u003cText style={[styles.color, {fontSize: fontScale(14)}]}\u003e150x150\u003c/Text\u003e\n          \u003cText style={[styles.color, {fontSize: fontScale(14)}]}\u003e\n            Scale: {scale(150)}x{scale(150)}\n          \u003c/Text\u003e\n        \u003c/View\u003e\n      \u003c/SafeAreaView\u003e\n    \u003c/ScrollView\u003e\n  );\n};\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  fontScale: {\n    fontSize: fontScale(16),\n  },\n  box: {\n    width: 150,\n    height: 150,\n    backgroundColor: 'black',\n    alignItems: 'center',\n    justifyContent: 'center',\n    margin: 16,\n  },\n  scale: {\n    width: scale(150),\n    height: scale(150),\n  },\n  color: {\n    color: 'white',\n  },\n});\n\nexport default App;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoaphantn7604%2Freact-native-utils-scale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoaphantn7604%2Freact-native-utils-scale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoaphantn7604%2Freact-native-utils-scale/lists"}