{"id":13833710,"url":"https://github.com/react-native-masked-view/masked-view","last_synced_at":"2025-07-10T01:32:41.548Z","repository":{"id":38460684,"uuid":"169555970","full_name":"react-native-masked-view/masked-view","owner":"react-native-masked-view","description":"React Native Masked View Library","archived":false,"fork":false,"pushed_at":"2024-11-04T05:19:29.000Z","size":1560,"stargazers_count":979,"open_issues_count":54,"forks_count":125,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-13T22:11:35.576Z","etag":null,"topics":["hacktoberfest","masked-view","react-native"],"latest_commit_sha":null,"homepage":"","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/react-native-masked-view.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T10:42:47.000Z","updated_at":"2024-11-13T20:22:52.000Z","dependencies_parsed_at":"2024-06-18T12:16:44.144Z","dependency_job_id":"7e9b3852-e2a8-440b-95eb-2669f67034fa","html_url":"https://github.com/react-native-masked-view/masked-view","commit_stats":{"total_commits":137,"total_committers":34,"mean_commits":4.029411764705882,"dds":0.708029197080292,"last_synced_commit":"a6e0d3d8da8c65bcf3e7f596bbbf453abf1866c9"},"previous_names":["react-native-community/react-native-masked-view"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-masked-view%2Fmasked-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-masked-view%2Fmasked-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-masked-view%2Fmasked-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-masked-view%2Fmasked-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-masked-view","download_url":"https://codeload.github.com/react-native-masked-view/masked-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224917516,"owners_count":17391906,"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":["hacktoberfest","masked-view","react-native"],"created_at":"2024-08-04T13:00:22.934Z","updated_at":"2024-11-20T18:31:02.031Z","avatar_url":"https://github.com/react-native-masked-view.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# React Native `MaskedView`\n\n[![Build Status][build-badge]][build]\n[![Version][version-badge]][package]\n[![MIT License][license-badge]][license]\n[![Lean Core Badge][lean-core-badge]][lean-core-issue]\n\nProvides a React component that renders a masked view.\n\n## Platforms Supported\n\n- [x] iOS\n- [x] Android\n- [x] Web\n\n## Getting Started\n\n```sh\nyarn add @react-native-masked-view/masked-view\n```\n\nor\n\n```sh\nnpm install --save @react-native-masked-view/masked-view\n```\n\n### Using React Native \u003e= 0.60\n\nLinking the package manually is not required anymore with [Autolinking](https://github.com/react-native-masked-view/cli/blob/master/docs/autolinking.md).\n\nRemember to install the pod with:\n\n```sh\nnpx pod-install\n```\n\n### Using React Native \u003c 0.60\n\nYou then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:\n\n```sh\nreact-native link @react-native-masked-view/masked-view\n```\n\n## Usage\n\nImport the `MaskedView` component from `@react-native-masked-view/masked-view` and use it like so:\n\n```jsx\nimport React from 'react';\nimport { Text, View } from 'react-native';\nimport MaskedView from '@react-native-masked-view/masked-view';\n\nconst App = () =\u003e {\n  return (\n    \u003cMaskedView\n      style={{ flex: 1, flexDirection: 'row', height: '100%' }}\n      maskElement={\n        \u003cView\n          style={{\n            // Transparent background because mask is based off alpha channel.\n            backgroundColor: 'transparent',\n            flex: 1,\n            justifyContent: 'center',\n            alignItems: 'center',\n          }}\n        \u003e\n          \u003cText\n            style={{\n              fontSize: 60,\n              color: 'black',\n              fontWeight: 'bold',\n            }}\n          \u003e\n            Basic Mask\n          \u003c/Text\u003e\n        \u003c/View\u003e\n      }\n    \u003e\n      {/* Shows behind the mask, you can put anything here, such as an image */}\n      \u003cView style={{ flex: 1, height: '100%', backgroundColor: '#324376' }} /\u003e\n      \u003cView style={{ flex: 1, height: '100%', backgroundColor: '#F5DD90' }} /\u003e\n      \u003cView style={{ flex: 1, height: '100%', backgroundColor: '#F76C5E' }} /\u003e\n      \u003cView style={{ flex: 1, height: '100%', backgroundColor: '#e1e1e1' }} /\u003e\n    \u003c/MaskedView\u003e\n  );\n}\n\nexport default App\n```\n\nThe following image demonstrates that you can put almost anything behind the mask. The three examples shown are masked `\u003cView\u003e`, `\u003cText\u003e`, and `\u003cImage\u003e`.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"img/example.png\" width=\"200\"\u003e\u003c/img\u003e\u003c/div\u003e\n\n### Web Usage\n\nyou need to install moden-screenshot package for web usage:\n```sh\nyarn add modern-screenshot\n```\n\n### Props\n\n- [View props...](https://github.com/facebook/react-native-website/blob/master/docs/view.md#props)\n\n- [`maskElement`](#maskelement)\n\n- [`androidRenderingMode`](#androidrenderingmode)\n\n### Reference\n\n### `maskElement`\n\n| Type    | Required |\n| ------- | -------- |\n| element | Yes      |\n\n### `androidRenderingMode`\n\nBy default `hardware` rendering mode will be used for best performance, however if you need to animate your `maskElement` then you’ll need to switch to `software` to get your mask to update. This prop only affects Android.\n\n| Type                   | Required | Default    |\n| ---------------------- | -------- | ---------- |\n| `software`, `hardware` | No       | `hardware` |\n\n\u003c!-- badges --\u003e\n\n[build-badge]: https://github.com/react-native-masked-view/masked-view/workflows/Build/badge.svg\n[build]: https://github.com/react-native-masked-view/masked-view/actions\n[version-badge]: https://img.shields.io/npm/v/@react-native-masked-view/masked-view.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@react-native-masked-view/masked-view\n[license-badge]: https://img.shields.io/npm/l/@react-native-masked-view/masked-view.svg?style=flat-square\n[license]: https://opensource.org/licenses/MIT\n[lean-core-badge]: https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square\n[lean-core-issue]: https://github.com/facebook/react-native/issues/23313\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-masked-view%2Fmasked-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-masked-view%2Fmasked-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-masked-view%2Fmasked-view/lists"}