{"id":26613464,"url":"https://github.com/gaddafirusli/react-native-image-overlay","last_synced_at":"2025-04-10T03:02:22.274Z","repository":{"id":31866646,"uuid":"129185097","full_name":"gaddafirusli/react-native-image-overlay","owner":"gaddafirusli","description":"React Native's ImageBackground with overlay","archived":false,"fork":false,"pushed_at":"2023-04-17T11:08:07.000Z","size":1000,"stargazers_count":87,"open_issues_count":11,"forks_count":23,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T13:07:24.780Z","etag":null,"topics":["image","imagebackground","react","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/gaddafirusli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-12T03:06:25.000Z","updated_at":"2025-02-19T12:09:59.000Z","dependencies_parsed_at":"2024-06-18T20:08:19.993Z","dependency_job_id":"af17f87c-764e-4572-a0f4-a7cc95e095d4","html_url":"https://github.com/gaddafirusli/react-native-image-overlay","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaddafirusli%2Freact-native-image-overlay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaddafirusli%2Freact-native-image-overlay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaddafirusli%2Freact-native-image-overlay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaddafirusli%2Freact-native-image-overlay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaddafirusli","download_url":"https://codeload.github.com/gaddafirusli/react-native-image-overlay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148219,"owners_count":21055547,"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":["image","imagebackground","react","react-native"],"created_at":"2025-03-24T04:25:07.063Z","updated_at":"2025-04-10T03:02:22.229Z","avatar_url":"https://github.com/gaddafirusli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    react-native-image-overlay\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003eReact Native \u003ccode\u003eImageBackground\u003c/code\u003e is useful. But you know what's even more useful?\u003cbr /\u003e\n\u003ccode\u003eImageBackground\u003c/code\u003e with overlay. This is exactly it.\u003c/p\u003e\n\n\n![Header image](image/header.png)\n\n\u003cbr /\u003e\n\n[![npm](https://img.shields.io/npm/dt/react-native-image-overlay.svg)](https://www.npmjs.com/package/react-native-image-overlay)\n\n## Get Started\n\n### Installation\n```bash\n$ npm install --save react-native-image-overlay\n```\n\n### Usage\n```javascript\nimport ImageOverlay from \"react-native-image-overlay\";\n\nexport class MyApp extends Component {\n    render () {\n        return (\n            // For external image\n            \u003cImageOverlay source={{ uri:\"http://example.com/img/cool.jpg\" }} /\u003e\n            // For local asset\n            \u003cImageOverlay source={require(\"../../assets/banner.png\")} /\u003e\n        )\n    }\n}\n```\n\n\u003cbr /\u003e\n\n## Props\n\n| Prop              | Description                                                                                | Type                | Default     |\n| ----------------- | ------------------------------------------------------------------------------------------ | ------------------- | ----------- |\n| `blurRadius`      | The blur radius of the blur filter added to the image                                      | Number              | `undefined` |\n| `containerStyle`  | Additional styling for the component                                                       | ViewStyle               | `undefined` |\n| `contentPosition` | Position of `title` text or child component (if any). | String (`\"top\"`,`\"center\"` or `\"bottom\"`)              | `\"center\"`  |\n| `height`          | The height of the whole component                                                          | Number              | `300`       |\n| `overlayColor`    | The color to be used for the overlay on top of the image                                   | String              | `\"#000000\"` |\n| `overlayAlpha`    | Opacity value of the overlay. From `0` to `1`                                              | Number              | `0.5`       |\n| `rounded`         | Value for `borderRadius` to be applied to the component                                    | Number              | `undefined` |\n| `source`          | The image source (either a remote URL or a local file resource).                           | ImageSource |             |\n| `title`           | Text to be displayed over the image                                                        | String              | `undefined` |\n| `titleStyle`      | Additional styling for the title text                                                      | TextStyle               | `undefined` |\n\n\u003cbr /\u003e\n\n## Example\n\n### 1. Simple overlay color\n\nThe most basic use-case of this module is to add colored overlay on top of your image.\n```javascript\n\u003cImageOverlay source={{ uri:\"http://example.com/img/cool.jpg\" }} /\u003e\n```\nDefault overlay is color is `#000000` with `0.5` opacity. You can customize it to any color\n```javascript\n\u003cImageOverlay\n    source={{ uri:\"http://example.com/img/cool.jpg\" }}\n    overlayColor=\"cyan\"\n    overlayAlpha={0.8} /\u003e\n```\n### 2. Overlay with title text\n\n![Title text image](image/titledemo.png)\n\nIf you want to display a simple white text on top of the image, you can use the `title` prop.\n```javascript\n\u003cImageOverlay\n    source={{ uri:\"http://example.com/img/cool.jpg\" }}\n    title=\"This is the title\" /\u003e\n```\nThe title will be `center`-ed by default. You can move it to the `top` or `bottom` using the `contentPosition` prop\n```javascript\n\u003cImageOverlay\n    source={{ uri:\"http://example.com/img/cool.jpg\" }}\n    title=\"This is the title\"\n    contentPosition=\"bottom\" /\u003e\n```\n\nAdditionally, you can change the styling by passing the `titleStyle` along\n```javascript\n\u003cImageOverlay\n    source={{ uri:\"http://example.com/img/cool.jpg\" }}\n    title=\"This is the title\"\n    titleStyle={{ color: 'yellow', fontWeight: 'bold' }} /\u003e\n```\n\n### 3. Overlay with child component\n\n![Child component image](image/customdemo.png)\n\nYou can pass extra components to be displayed on top of your image.\n```javascript\n\u003cImageOverlay\n  source={{ uri:\"http://example.com/img/cool.jpg\" }}\n  height={0.7 * height} \n  contentPosition=\"bottom\"\u003e\n    \u003cView\u003e\n        \u003cImage style={styles.avatar} source={{uri:\"http://example.com/user/avatar.png\"}} /\u003e\n        \u003cText style={styles.name}\u003eAmelia Edwards\u003c/Text\u003e\n        \u003cText style={styles.location}\u003eKuala Lumpur, Malaysia\u003c/Text\u003e\n        \u003cButton text=\"Follow me\" /\u003e\n    \u003c/View\u003e\n\u003c/ImageOverlay\u003e\n```\n\u003e Note: When you are using child component, `title` prop will be ignored.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaddafirusli%2Freact-native-image-overlay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaddafirusli%2Freact-native-image-overlay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaddafirusli%2Freact-native-image-overlay/lists"}