{"_id":"@arcturis/react-native-root-toast","_rev":"4-621193ff9105022e4aa0bbf4e1a99e4b","name":"@arcturis/react-native-root-toast","dist-tags":{"latest":"3.2.6"},"versions":{"3.2.2":{"version":"3.2.2","name":"@arcturis/react-native-root-toast","author":{"name":"arcturis"},"description":"react native toast like component, pure javascript solution","repository":{"type":"git","url":"git+https://github.com/luckyli/react-native-root-toast.git"},"license":"MIT","main":"./index.js","types":"./index.d.ts","keywords":["react-component","react-native","ios","android","image","video","focus"],"dependencies":{"prop-types":"^15.5.10","react-native-root-siblings":"^4.0.0"},"peerDependencies":{"react-native":">=0.47.0"},"gitHead":"aa68ba68bab933beb1b3d3b9d09311ce1088eb9d","bugs":{"url":"https://github.com/luckyli/react-native-root-toast/issues"},"homepage":"https://github.com/luckyli/react-native-root-toast#readme","_id":"@arcturis/react-native-root-toast@3.2.2","_nodeVersion":"12.16.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Afw/9QRubB8Xl/IylWgezcn9Sfnu/59Kx1w8HT4GWnHwCTNxdiOqRMOnrBGI2lJ2Q795SyOMLhrGmXErsemR5w==","shasum":"814870aa155acf834db1846641d6fb8d9abdbfbf","tarball":"https://registry.npmjs.org/@arcturis/react-native-root-toast/-/react-native-root-toast-3.2.2.tgz","fileCount":5,"unpackedSize":9161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbYaZCRA9TVsSAnZWagAA8WMQAIUJu0qNws+Pm82hTpba\nWaSAZBHtGcP531KQmmGVWqlmfov9GaUvuCZjcSP9anDavDy2kCaZp6FShZud\ne2XFoCydIylPUSXfDYHWYa2JTZRS5MZ0A3uwYoIIIhc316eE/Jb+9rh2nEIi\nR0SnCBQL9TaHhaIMGCkYC/qrr99E0qivJUtPNGJUM8iRtkLYd/bgLobmF40q\nefCP48SHdfoQJB7dxRIeQbhsblH4J0UJ/1L7IgUXnXMEK1eAsxKNuePdAJP7\nfo7LpA9drWuML851rGgc3dmIG3s35e2qhrZaodoyyQSevbjCCZMmUEcZ2Qjm\nS2ELa1PNBQvpL5Y5oeX2yMfapKRj+IwR/Yd39ox0baTjd7H2ROatob8D5UnE\nKktZRxwFdFyGEWKao7DABsK6py3gL02hpZvk/jFfgTKuv9Je1wvA5+HvzkCN\n+cq2ScnRfmWjwo0BMFln+o2r8Zn/evVyq0AyucZOyitRQSH2QqjuK+DFz5Yz\nb3xkjg7Hd0eKlnHNJHrnulJBA8aNcdK9txRyFoTFvSKdQfdezmogqxZvz6EU\nOBnZ8f5h/gJsnBUb15l6Hrr0Vta1s0UOhg41JuBbuPm9O2kHysVyu5Y8LBjD\npQn4oqSwgNgHhHTQKUl8fKTb42Lysf0QmmNEzZNQylK1SF2IXAJKecmr9JCL\nS7bg\r\n=XIpT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsCRRXN31xfkpnDlveIA2ZR8duqKGH0wt7VW3aJM5OVAiEA43KbSIwyDiQH3+PNpZjaDbKZsVoiopbJd1/7Ksyd3DY="}]},"maintainers":[{"name":"arcturis","email":"48585478@qq.com"}],"_npmUser":{"name":"arcturis","email":"48585478@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-root-toast_3.2.2_1601013401113_0.00420962132325986"},"_hasShrinkwrap":false},"3.2.4":{"version":"3.2.4","name":"@arcturis/react-native-root-toast","author":{"name":"arcturis"},"description":"react native toast like component, pure javascript solution","repository":{"type":"git","url":"git+https://github.com/luckyli/react-native-root-toast.git"},"license":"MIT","main":"./index.js","types":"./index.d.ts","keywords":["react-component","react-native","ios","android","image","video","focus"],"dependencies":{"prop-types":"^15.5.10","react-native-root-siblings":"^4.0.0"},"peerDependencies":{"react-native":">=0.47.0"},"gitHead":"d02e52f56fee31e14da7c8d6ebb6d885c459a51d","bugs":{"url":"https://github.com/luckyli/react-native-root-toast/issues"},"homepage":"https://github.com/luckyli/react-native-root-toast#readme","_id":"@arcturis/react-native-root-toast@3.2.4","_nodeVersion":"12.16.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-bM5dZRxv08biOELEboqgMxFdV6CdPUK4qVAVmNauNsXk+MJzXTWqLYccb9CBIEIcXadCerNRbLtAAhCjL+abUQ==","shasum":"decca908503d026d5fc574855ac6784d21ffbbd1","tarball":"https://registry.npmjs.org/@arcturis/react-native-root-toast/-/react-native-root-toast-3.2.4.tgz","fileCount":45,"unpackedSize":4642238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbZ2cCRA9TVsSAnZWagAAJtAP+gIBW7yqm+CMD8bj/+k0\nXi7H/zY8qY4y40usGe7+I2vzc+9R4fUQ2jOHD4QEYvQA9akLtAKsRiL0tt9g\ngHo6s0XM9PLi/rPDlkZK8i2D6dWE88LbBeO7qH1IcYYJwF2u+Xid8GnCG8mO\nlSTS3Dv8rBEGBdetqSMeuFt/mqewuCmkDjAg6Q11GU2MyI9XcDNlKaY+iRDn\nBE9oG8Yi+Bmx5/SjiJm7SXIylhlMIaXVN4APL/lJ7pkYQ71EWN8AyFKWVkYq\n2afoMB/RLhUckckiVFfu5B+G9kRrwHYZIyh+VNhCze4vBYXsg8i0JNB8L2qL\no1+xOAF+wNxhEZegDliwOFGTjTuLdcqLhcHug0hVUPksPkU+67Ls8+eOdimt\nV2jA5yRueCVeTnial7NWh5ARfKm6H1eYZp1ftKNClG6/fuFLS3uN9hs9slBG\nJzTWULj/InBAGu9G6+m10uXkF5OUMvQv26a6hZvfjfyyodTFVksDFoVv/0ZH\nGn8TjZAI/yuqKB8j5KnQUppv4jXtOiJ18g/ti88TvJyvcmqBbUdwTrLQMRKV\nnw6WGZ3LybEuIO6rMD+a0azMPnfhry0+c/EpsSaIpZK0S3NXtmr2bLKhkDmc\nadpBagvZeR6N760MZ93ij3xCImzNNBa3hdZhIBEM9KXskHYrVSgmyBrB2You\nrH2x\r\n=Zinu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4afqKQ1Bg5tpdp51EL3lg8Z2/cir9g2owdPcg1u0CZAiEA2qHLHE1JpzTNiQrVZ04vGK+J0pryANnEoLT0QJM5zu4="}]},"maintainers":[{"name":"arcturis","email":"48585478@qq.com"}],"_npmUser":{"name":"arcturis","email":"48585478@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-root-toast_3.2.4_1601019292309_0.3283095981650257"},"_hasShrinkwrap":false},"3.2.5":{"version":"3.2.5","name":"@arcturis/react-native-root-toast","author":{"name":"arcturis"},"description":"react native toast like component, pure javascript solution","repository":{"type":"git","url":"git+https://github.com/luckyli/react-native-root-toast.git"},"license":"MIT","main":"./index.js","types":"./index.d.ts","keywords":["react-component","react-native","ios","android","image","video","focus"],"dependencies":{"prop-types":"^15.5.10","react-native-root-siblings":"^4.0.0"},"peerDependencies":{"react-native":">=0.47.0"},"gitHead":"d02e52f56fee31e14da7c8d6ebb6d885c459a51d","bugs":{"url":"https://github.com/luckyli/react-native-root-toast/issues"},"homepage":"https://github.com/luckyli/react-native-root-toast#readme","_id":"@arcturis/react-native-root-toast@3.2.5","_nodeVersion":"12.16.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-3qTjEMQ5vBvzYfLlwohugxcVR4gkFuP6XJnmPI4KdUdKJZyKXjo1NYftQfkVpNWFLNDbafyxT4o1fDMK3BH4zg==","shasum":"d89da2ebc204c4da81e16a0d601c286993e99560","tarball":"https://registry.npmjs.org/@arcturis/react-native-root-toast/-/react-native-root-toast-3.2.5.tgz","fileCount":45,"unpackedSize":4642238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbaFJCRA9TVsSAnZWagAAacgP/R9ciHZKu8zLpDMM6zSq\n1OEXxdimT6Up5i0i4sw3KKh+NUobOrHpm7fyTV9+7AT0PxaSB9XYALkSnMSS\nNmHzXNJetRAVbWE0rfHYqn1VhbiT0Y3xyAwQE1iJxyhffo3hP7HkcSzG5BjV\nxm7KPB3Vipp4Bm7o5HVmLU7cJ433CpyFlMrtnOZwMaQK8HSvNFueSYdBsppC\nB5mIv62qm3/wuU9p8kI6shsdxFlqJOxi9SZGRRquR5mmcWr6vke7M5WrgbTQ\nl/KxwlVJL5XbSgzneDrbDlRrHllkOHqXOTs+MweRQ8BC+qAv4M3lWXw8yPYs\nqj1Z3tiBoVGKenkoxL74PbcXv8UwHGyReXAOJ0H/U02yLeHpmj/iPeAOprkB\n8Xi5zKWAO9unc6kEIPBY96lQxgCHWR6ingYk8FsRMgcynFGHpgdq2YtxXW9o\n6DpGP8wNCcg+sJM2Baglw7dLQvj0/M9urt7BC4QX9/ldLBCC0vju7e2/HbDf\nl7Y4bVHrodzHf5KgDGG34OmqU160Y1rdZO0jzDl2jSSnQtCcDGCEXgDjTxi8\n30yCqI7k88QFZH/Lwr/oU/dmAEPIPGT1xFU2TnHtQBZyZoUOapGWVPvqI6Pv\nCf1X0TCgspyP8xLDAhZCXzV/WClLorH0JkXWahPNyn3nkNPxiKaX7QzU+KQD\nuVro\r\n=h51M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDf9vASTFe76lYIxbkAJbYd323IwbZJ1bERMxVPlIPl8QIhAJY7ptloyequ+Iitln4+gYgEHU/P+wblq/1r4wmHBajr"}]},"maintainers":[{"name":"arcturis","email":"48585478@qq.com"}],"_npmUser":{"name":"arcturis","email":"48585478@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-root-toast_3.2.5_1601020232608_0.7693849501948544"},"_hasShrinkwrap":false},"3.2.6":{"version":"3.2.6","name":"@arcturis/react-native-root-toast","author":{"name":"arcturis"},"description":"react native toast like component, pure javascript solution","repository":{"type":"git","url":"git+https://github.com/luckyli/react-native-root-toast.git"},"license":"MIT","main":"./index.js","types":"./index.d.ts","keywords":["react-component","react-native","ios","android","image","video","focus"],"dependencies":{"prop-types":"^15.5.10","react-native-root-siblings":"^4.0.0"},"peerDependencies":{"react-native":">=0.47.0"},"gitHead":"d02e52f56fee31e14da7c8d6ebb6d885c459a51d","bugs":{"url":"https://github.com/luckyli/react-native-root-toast/issues"},"homepage":"https://github.com/luckyli/react-native-root-toast#readme","_id":"@arcturis/react-native-root-toast@3.2.6","_nodeVersion":"12.16.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-0RFu6DGuduIJUstmre4dj/eEv3jG9x47Or8RzNDB4X/cNIuzKcD5TGZhs+oZ0lTF5zv34hVUaTGsylx7lHnlWw==","shasum":"a1a5ae4b88399ac6e49ad4c1fb4696db601b0851","tarball":"https://registry.npmjs.org/@arcturis/react-native-root-toast/-/react-native-root-toast-3.2.6.tgz","fileCount":45,"unpackedSize":4642248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbaLgCRA9TVsSAnZWagAA4q8QAI9j99sQHRdAXVe810JQ\nZPOMMuh7UKDsNE0Z3K64nIPIDtdz51nqshAmjoBgnPa4VBi/80Q/2RTevoov\n/aSeAV+KHciS2rC9PhFCCtkA2XtVsAdm+0J4t3FdkWvArkPT89UoQJu76es4\nk+ZwV9Ao5BzQWue8mRtA+2nxEsyo8jyJfiwdNmRo5rWZyqxxBpFLxzzG1A7f\nin+dx7qo0QkkfKLJ5BuFhwbxJb/QQ0NlhEH0CiueYmAaHvOkkwghWgCJQLJQ\nnkT5y/oaeOu3xQWvv1ywc3QFFGjTiiIVbwOyNrG8iwwmQv7r8VRNmU1KokAD\ne3X0zsomkyjU0q3+txIBGn5jcG6Zfp41cu6sLn+D8nBGbWwDqpXv9uR6GI8r\nsf637JnrVYYw8uZPAKSHt8tbSjFVOupcEjnie9FyaC6AVo/pFi0b2BIaBmz6\nDgZS1fbLtMfhMy2GoXs3QpaaCpR6Qgub3EbU3fb6lgUYlB3ONolnYixxDs9I\nkxNmwxDCQ8YI3gPniAd/sSDYOkHfPzxlQbL4mnE5yiX87KmnYP2cIBtzqD4m\nczEgTSPr2QApLv2+vS9EN5Y9BhEpOwpTlYF54ikoHsYDBfRbmW1R5540U0Kq\nkowcODO4snHTt8tYZkYlzHjGIKHslUyGJbL7kNEOvIkN5wLjElq0b7EvXRjn\nRSsT\r\n=bGeh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3itl7gxDcu1m50QIF63H+i0Ps/ps91yrCAIiyTtM36gIhAPIY8UKQygljzsoloG+Hb0Kx7QEHHB5uGfQAC6Z8nwIX"}]},"maintainers":[{"name":"arcturis","email":"48585478@qq.com"}],"_npmUser":{"name":"arcturis","email":"48585478@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-root-toast_3.2.6_1601020639801_0.11923739192388916"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-25T05:56:41.073Z","3.2.2":"2020-09-25T05:56:41.243Z","modified":"2022-04-04T15:22:11.557Z","3.2.4":"2020-09-25T07:34:52.537Z","3.2.5":"2020-09-25T07:50:33.006Z","3.2.6":"2020-09-25T07:57:20.176Z"},"maintainers":[{"name":"arcturis","email":"48585478@qq.com"}],"description":"react native toast like component, pure javascript solution","homepage":"https://github.com/luckyli/react-native-root-toast#readme","keywords":["react-component","react-native","ios","android","image","video","focus"],"repository":{"type":"git","url":"git+https://github.com/luckyli/react-native-root-toast.git"},"author":{"name":"arcturis"},"bugs":{"url":"https://github.com/luckyli/react-native-root-toast/issues"},"license":"MIT","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> react-native-root-toast >= 2.1.0 only supports react-native >= 0.47.0 , for lower version choose 2.0.0 or below.\n\nIn react native >= 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```\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  <RootSiblingParent>  // <- use RootSiblingParent to wrap your root component\n    <App />\n  </RootSiblingParent>\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```\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: () => {\n        // calls on toast\\`s appear animation start\n    },\n    onShown: () => {\n        // calls on toast\\`s appear animation end.\n    },\n    onHide: () => {\n        // calls on toast\\`s hide animation start.\n    },\n    onHidden: () => {\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 `<Toast />` is unmounted.\n\n```\nimport React, {Component} from 'react-native';\nimport Toast from 'react-native-root-toast';\n\nclass Example extends Component{\n    constructor() {\n        super(...arguments);\n        this.state = {\n            visible: false\n        };\n    }\n\n    componentDidMount() {\n        setTimeout(() => this.setState({\n            visible: true\n        }), 2000); // show toast after 2s\n\n        setTimeout(() => this.setState({\n            visible: false\n        }), 5000); // hide toast after 5s\n    };\n\n    render() {\n        return <Toast\n            visible={this.state.visible}\n            position={50}\n            shadow={false}\n            animation={false}\n            hideOnPress={true}\n        >This is a message</Toast>;\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","readmeFilename":"README.md"}