{"id":3972,"url":"https://github.com/magicismight/react-native-root-toast","last_synced_at":"2026-10-19T09:08:02.172Z","repository":{"id":4239391,"uuid":"52331132","full_name":"magicismight/react-native-root-toast","owner":"magicismight","description":"react native toast like component, pure javascript solution","archived":false,"fork":false,"pushed_at":"2025-11-07T00:15:40.000Z","size":4592,"stargazers_count":2137,"open_issues_count":95,"forks_count":393,"subscribers_count":29,"default_branch":"master","last_synced_at":"2026-10-07T16:45:14.808Z","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.txt","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,"zenodo":null}},"created_at":"2016-02-23T04:52:07.000Z","updated_at":"2026-09-24T07:01:50.000Z","dependencies_parsed_at":"2024-04-28T06:22:58.091Z","dependency_job_id":"345f34e9-2cce-4695-9eae-749fca822d27","html_url":"https://github.com/magicismight/react-native-root-toast","commit_stats":{"total_commits":71,"total_committers":24,"mean_commits":"2.9583333333333335","dds":0.5915492957746479,"last_synced_commit":"a21d38a5733649f340891b4816d4f00730306831"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/magicismight/react-native-root-toast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicismight","download_url":"https://codeload.github.com/magicismight/react-native-root-toast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicismight%2Freact-native-root-toast/sbom","scorecard":{"id":611731,"data":{"date":"2025-08-11","repo":{"name":"github.com/magicismight/react-native-root-toast","commit":"c4f2f67406e65f0d1355837b68e47b9c41aa537a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":4,"reason":"Found 10/24 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: Example/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T02:50:04.996Z","repository_id":4239391,"created_at":"2025-08-21T02:50:04.997Z","updated_at":"2025-08-21T02:50:04.997Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38352878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:57.296Z","updated_at":"2026-10-19T09:08:01.713Z","avatar_url":"https://github.com/magicismight.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript","Installation","Libraries","Others"],"sub_categories":["UI"],"readme":"## react-native-root-toast [![npm version](https://badge.fury.io/js/react-native-root-toast.svg)](http://badge.fury.io/js/react-native-root-toast)\n\n-----------------------\n\n#### Features\n1. Pure javascript solution.\n2. Support both Android and iOS.\n3. Lots of custom options for Toast.\n4. You can show/hide Toast by calling api or using Component inside render.\n\n![screen-shoots](./Example/screen-shoots.gif)\n\n### Install\n\n`npm install react-native-root-toast`\n\n\u003e react-native-root-toast \u003e= 2.1.0 only supports react-native \u003e= 0.47.0 , for lower version choose 2.0.0 or below.\n\nIn react native \u003e= 0.62, the new LogBox component would impact this component's initialization. To make it work we have to explicitly insert a mount point in your app like this:\n\n```js\n// in your entry file like `App.js`\n\n// In theory you don't have to install `react-native-root-siblings` because it's a dep of root-toast\n// But you can install it explicitly if your editor complains about it.\nimport { RootSiblingParent } from 'react-native-root-siblings';\n\n// in your render function \nreturn (\n  \u003cRootSiblingParent\u003e  // \u003c- use RootSiblingParent to wrap your root component\n    \u003cApp /\u003e\n  \u003c/RootSiblingParent\u003e\n);\n            \n```\n\nYou can skip this step if your react-native is lower than 0.62. And actually you can inject RootSiblingParent into anywhere like a react portal, for example if you have multiple rootviews you can choose where to display the root toast.\n\nRead more about [`react-native-root-siblings`](https://github.com/magicismight/react-native-root-siblings) which powers `react-native-root-toast`. \n\n\n### Usage\n\nThere are two different ways to manage a Toast.\n\n##### **Calling api**\n\n```js\nimport Toast from 'react-native-root-toast';\n\n\n// Add a Toast on screen.\nlet toast = Toast.show('This is a message', {\n    duration: Toast.durations.LONG,\n    position: Toast.positions.BOTTOM,\n    shadow: true,\n    animation: true,\n    hideOnPress: true,\n    delay: 0,\n    onShow: () =\u003e {\n        // calls on toast\\`s appear animation start\n    },\n    onShown: () =\u003e {\n        // calls on toast\\`s appear animation end.\n    },\n    onHide: () =\u003e {\n        // calls on toast\\`s hide animation start.\n    },\n    onHidden: () =\u003e {\n        // calls on toast\\`s hide animation end.\n    }\n});\n\n// You can manually hide the Toast, or it will automatically disappear after a `duration` ms timeout.\nsetTimeout(function () {\n    Toast.hide(toast);\n}, 500);\n\n```\n\n##### **Using a Component**\n\n**NOTE:**\nShowing a toast by using a Component inside render, The toast will be automatically disappeared when the `\u003cToast /\u003e` is unmounted.\n\n```js\nimport React, {Component} from 'react-native';\nimport Toast from 'react-native-root-toast';\n\nclass Example extends Component{\n    state = {\n        visible: false\n    }\n\n    componentDidMount() {\n        setTimeout(() =\u003e this.setState({\n            visible: true\n        }), 2000); // show toast after 2s\n\n        setTimeout(() =\u003e this.setState({\n            visible: false\n        }), 5000); // hide toast after 5s\n    };\n\n    render() {\n        return \u003cToast\n            visible={this.state.visible}\n            position={50}\n            shadow={false}\n            animation={false}\n            hideOnPress={true}\n        \u003eThis is a message\u003c/Toast\u003e;\n    }\n}\n\n```\n\n---\n\n## Reference\n\n### Props\n\nName                | Default                  |  Type    | Description\n--------------------|--------------------------|----------|---------------------------\nduration            | Toast.durations.SHORT    | Number   | The duration of the toast. (Only for api calling method)\nvisible             | false                    | Bool     | The visibility of toast. (Only for Toast Component)\nposition            | Toast.positions.BOTTOM   | Number   | The position of toast showing on screen (A negative number represents the distance from the bottom of screen. A positive number represents the distance form the top of screen. `0` will position the toast to the middle of screen.)\nanimation           | true                     | Bool     | Should preform an animation on toast appearing or disappearing.\nshadow              | true                     | Bool     | Should drop shadow around Toast element.\nbackgroundColor     | null                     | String   | The background color of the toast.\nshadowColor         | null                     | String   | The shadow color of the toast.\ntextColor           | null                     | String   | The text color of the toast.\ndelay               | 0                        | Number   | The delay duration before toast start appearing on screen.\nhideOnPress         | true                     | Bool     | Should hide toast that appears by pressing on the toast.\nopacity             | 0.8                      | Number   | The Toast opacity.\nonShow              | null                     | Function | Callback for toast\\`s appear animation start\nonShown             | null                     | Function | Callback for toast\\`s appear animation end\nonHide              | null                     | Function | Callback for toast\\`s hide animation start\nonHidden            | null                     | Function | Callback for toast\\`s hide animation end\n\n### Constants\n\n##### Toast.durations\n\npresets of duration of the toast.\n\n1. Toast.durations.SHORT (equals to *2000*)\n\n2. Toast.durations.LONG (equals to *3500*)\n\n##### Toast.positions\n\npresets of position of toast.\n\n1. Toast.positions.TOP (equals to *20*)\n\n2. Toast.positions.BOTTOM (equals to *-20*)\n\n3. Toast.positions.CENTER (equals to *0*)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicismight%2Freact-native-root-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicismight%2Freact-native-root-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicismight%2Freact-native-root-toast/lists"}