{"id":4048,"url":"https://github.com/magicismight/react-native-root-modal","last_synced_at":"2025-04-12T17:40:59.875Z","repository":{"id":43961664,"uuid":"49820744","full_name":"magicismight/react-native-root-modal","owner":"magicismight","description":"A pure JavaScript solution for react native`s modal component","archived":false,"fork":false,"pushed_at":"2024-03-10T12:43:33.000Z","size":2188,"stargazers_count":366,"open_issues_count":10,"forks_count":56,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-14T00:31:36.261Z","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/magicismight.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}},"created_at":"2016-01-17T14:32:25.000Z","updated_at":"2024-07-06T20:07:48.000Z","dependencies_parsed_at":"2024-04-25T00:41:15.340Z","dependency_job_id":"b9cd869a-df15-4483-affc-c218b99283f2","html_url":"https://github.com/magicismight/react-native-root-modal","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicismight","download_url":"https://codeload.github.com/magicismight/react-native-root-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248607648,"owners_count":21132579,"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:16:59.506Z","updated_at":"2025-04-12T17:40:59.857Z","avatar_url":"https://github.com/magicismight.png","language":"JavaScript","readme":"# react-native-root-modal [![npm version](https://badge.fury.io/js/react-native-root-modal.svg)](http://badge.fury.io/js/react-native-root-modal)\n\n------------------------\n\n## Features\n1. Pure javascript solution, easy to install.\n2. Support both `React element` way and `javascript class` way to invoke, easy to use.\n3. Inherited from `\u003cView /\u003e` you can set your own style or animation or anything you can do with View.\n4. ~~redux support~~.\n\n## Breaking changes\n\n### 5.x\nFrom 5.x redux support is not enabled by default.\nThe redux support can be enabled by setting a redux context wrapper.\n\n```\nimport { setSiblingWrapper } from 'react-native-root-siblings';\nimport { Provider } from 'react-redux';\n\n// const store = ... get store;\n\n// Call this before using redux context inside RootSiblings.\nsetSiblingWrapper((sibling) =\u003e \u003cProvider store={store}\u003e{sibling}\u003c/Provider\u003e);\n```\n\n\n## Install\n\n`npm install react-native-root-modal`\n\n## Usage\n\nImport library any where inside your code before `AppRegistry.registerComponent` is called.\n\n```\nimport Modal, { AnimatedModal, ModalManager } from 'react-native-root-modal';\n```\n\nInvoked by `React element` way.\n\n```\n....other elements before\n\u003cModal\n    style={{\n        top: 0,\n        right: 0,\n        bottom: 0,\n        left: 0,\n        backgroundColor: 'rgba(0, 0, 0, 0.2)',\n        transform: [{scale: this.state.scaleAnimation}]\n    }}\n\n    visible={this.state.modalVisible}\n\u003e\n    ... You can add anything inside\n\u003c/Modal\u003e\n....other elements after\n\n```\n\nJust put `\u003cModal /\u003e` element anywhere, And it will be front of other elements.\nAnd you can set `\u003cModal /\u003e` element\\`s style or other properties inherited from `\u003cView /\u003e` element\n\n\nOr you can invoke it by `JavaScript class` way\n\nImport modal Manager class.\n```\nimport { ModalManager } from 'react-native-root-modal';\n\n```\n\nInvoke it.\n```\n// Create a Modal element on screen.\nlet modal = new ModalManager(\u003cView style={modal container style}\u003e\n    ...modal contents here.\n\u003c/View\u003e);\n\n// Update (replace) the modal element which is already existed.\nmodal.update(\u003cView style={modal container style}\u003e\n    ...other modal contents here.\n\u003c/View\u003e);\n\n// Destroy it\nmodal.destroy();\n```\n\n## Example\n\n### IOS\n----\n![Example](./Example/screenShoot.ios.gif)\n\n### Android\n----\n![Example](./Example/screenShoot.android.gif)\n## Notice\n\nModal element created by this library can\\`t cover other `native` Modal elements,like: [Official Modal Element](http://facebook.github.io/react-native/docs/modal.html#content)\n","funding_links":[],"categories":["Components","JavaScript","Others"],"sub_categories":["UI","Dialog/Modal/Alert"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicismight%2Freact-native-root-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicismight%2Freact-native-root-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicismight%2Freact-native-root-modal/lists"}