{"id":13415451,"url":"https://github.com/lelandrichardson/react-primitives","last_synced_at":"2025-05-14T04:07:38.686Z","repository":{"id":53566249,"uuid":"54521013","full_name":"lelandrichardson/react-primitives","owner":"lelandrichardson","description":"Primitive React Interfaces Across Targets","archived":false,"fork":false,"pushed_at":"2022-11-29T08:07:47.000Z","size":430,"stargazers_count":3084,"open_issues_count":25,"forks_count":108,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-05-04T05:03:05.969Z","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/lelandrichardson.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":"2016-03-23T01:27:07.000Z","updated_at":"2025-03-21T15:16:46.000Z","dependencies_parsed_at":"2023-01-22T01:16:00.165Z","dependency_job_id":null,"html_url":"https://github.com/lelandrichardson/react-primitives","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelandrichardson%2Freact-primitives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelandrichardson%2Freact-primitives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelandrichardson%2Freact-primitives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lelandrichardson%2Freact-primitives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lelandrichardson","download_url":"https://codeload.github.com/lelandrichardson/react-primitives/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069219,"owners_count":22009512,"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-07-30T21:00:48.961Z","updated_at":"2025-05-14T04:07:38.610Z","avatar_url":"https://github.com/lelandrichardson.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-primitives\n\nPrimitive React Interfaces Across Targets\n\n[![npm](https://img.shields.io/npm/v/react-primitives)]((https://www.npmjs.com/package/react-primitives))\n\n## Installation\n\n```sh\nnpm install --save react-primitives\n```\n\nYou will also need to install the targets you want to support:\n\n- web:\n  ```sh\n  npm install --save react-dom react-native-web react-art\n  ```\n- native iOS and Android:\n  ```sh\n  npm install --save react-native\n  ```\n- sketch:\n  ```sh\n  npm install --save react-sketchapp react-test-renderer\n  ```\n- figma:\n  ```sh\n  npm install --save react-figma\n  ```\n- vr:\n  ```sh\n  npm install --save react-360\n  ```\n- Windows:\n  ```sh\n  npm install --save react-native-windows\n  ```\n\n### Usage\n\n```jsx\nimport React from \"react\";\nimport { View, Text, Image, StyleSheet } from \"react-primitives\";\n\nclass Foo extends React.Component {\n  render() {\n    return \u003cView style={styles.foo}\u003e{this.props.children}\u003c/View\u003e;\n  }\n}\n\nconst styles = StyleSheet.create({\n  foo: {\n    width: 100,\n    height: 100,\n    backgroundColor: \"#ff00ff\"\n  }\n});\n```\n\n## What is this?\n\nThis library attempts to propose an ideal set of primitives around building\nReact applications, regardless of Platform. In the future, this could be\nused as a shared interface among React and React Native components that\ndon't use platform-specific APIs.\n\nImportantly, this includes `StyleSheet` for declaring styles, as well as\n`Animated` for doing declarative Animations.\n\nThe exported APIs thus far are:\n\n1. `Animated`: Pulled from the [animated](https://github.com/animatedjs/animated) project.\n2. `StyleSheet`: Follows React Native's StyleSheet API.\n3. `View`: A base component for Layout.\n4. `Text`: A base component for Text rendering.\n5. `Image`: A base component for Image rendering.\n6. `Touchable`: A base component for interaction.\n7. `Easing`: A base set of easing functions.\n8. `Dimensions`: Get the devices dimensions.\n9. `PixelRatio`: Get the devices pixel density.\n10. `Platform`: Get information about the platform. (iOS, Android, Web, Sketch, VR,...)\n\nIn the future, a `TextInput` component may also be added.\n\n## Props where props are due\n\nThis library was largely inspired from the work done by [Nicolas Gallager](https://github.com/necolas)\nand his great work on the [react-native-web](https://github.com/necolas/react-native-web) library. A few of the files\nin this repo are even copied directly from his project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flelandrichardson%2Freact-primitives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flelandrichardson%2Freact-primitives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flelandrichardson%2Freact-primitives/lists"}