{"id":4309,"url":"https://github.com/benzhe/react-native-relative-units","last_synced_at":"2025-08-04T01:31:51.692Z","repository":{"id":57339515,"uuid":"42162699","full_name":"benzhe/react-native-relative-units","owner":"benzhe","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-23T08:20:44.000Z","size":3,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T21:51:54.089Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/benzhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-09T07:20:55.000Z","updated_at":"2023-03-09T02:37:04.000Z","dependencies_parsed_at":"2022-09-13T02:00:28.725Z","dependency_job_id":null,"html_url":"https://github.com/benzhe/react-native-relative-units","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benzhe%2Freact-native-relative-units","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benzhe%2Freact-native-relative-units/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benzhe%2Freact-native-relative-units/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benzhe%2Freact-native-relative-units/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benzhe","download_url":"https://codeload.github.com/benzhe/react-native-relative-units/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228582487,"owners_count":17940587,"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","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":[],"created_at":"2024-01-05T20:17:07.810Z","updated_at":"2024-12-07T08:30:28.204Z","avatar_url":"https://github.com/benzhe.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["UI"],"readme":"# react-native-relative-units\n\nAn simplest relative units module for react native. Design for scale pages in different devices, NOT FOR RESPONSIVE DESIGN.\n\n## Install\n\n```\nnpm install react-native-relative-units --save\n```\n\n## Using\n\n```\nvar {bp, vw, vh} = require('react-native-relative-units')(/* Mockup page's width */);\n```\n\n## Example\n\n```\nvar {bp, vw, vh} = require('react-native-relative-units')(375);\n\nvar styles = StyleSheet.create({\n    viewport: {\n        width: 375 * bp,    // 100% device width, same as width: 100 * wh\n        height: 100 * vh,   // 100% device height\n        marginTop: 20 * bp, // 20/375 device width\n        borderWidth: 1      //  bp is not recommend in border \n    }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenzhe%2Freact-native-relative-units","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenzhe%2Freact-native-relative-units","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenzhe%2Freact-native-relative-units/lists"}