{"id":18369809,"url":"https://github.com/cawfree/react-native-buttered-toast","last_synced_at":"2025-04-06T18:32:33.899Z","repository":{"id":35099443,"uuid":"204803233","full_name":"cawfree/react-native-buttered-toast","owner":"cawfree","description":"A customizable toast notification for React Native.","archived":false,"fork":false,"pushed_at":"2023-01-04T09:21:53.000Z","size":3717,"stargazers_count":8,"open_issues_count":19,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T13:11:21.085Z","etag":null,"topics":["native","notification","popup","react","react-native","toast"],"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/cawfree.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}},"created_at":"2019-08-27T22:48:19.000Z","updated_at":"2022-06-02T18:42:01.000Z","dependencies_parsed_at":"2023-01-15T14:00:50.683Z","dependency_job_id":null,"html_url":"https://github.com/cawfree/react-native-buttered-toast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-buttered-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-buttered-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-buttered-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-buttered-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cawfree","download_url":"https://codeload.github.com/cawfree/react-native-buttered-toast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247531310,"owners_count":20953932,"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":["native","notification","popup","react","react-native","toast"],"created_at":"2024-11-05T23:32:15.469Z","updated_at":"2025-04-06T18:32:29.783Z","avatar_url":"https://github.com/cawfree.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/cawfree"],"categories":[],"sub_categories":[],"readme":"# 🍞 react-native-buttered-toast\nAn utterly, butterly, customizable toast notification for React Native. Display any React `\u003cComponent /\u003e` as a Toast notification.\n\nSupports Android, iOS and Web.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./bin/out.gif\" alt=\"react-native-buttered-toast\" width=\"270\" height=\"556\"\u003e\n\u003c/p\u003e\n\n## 🚀 Getting Started\n\nUsing [`npm`]():\n\n```sh\nnpm install --save react-native-buttered-toast\n```\n\nUsing [`yarn`]():\n\n```sh\nyarn add react-native-buttered-toast\n```\n\n## ✍️ Example\n\nThere are a couple of prerequisites to be aware of before using this library:\n\n  - You must use a `\u003cButteredToastProvider\u003e` at the graphical root of your application.\n    - `react-native-buttered-toast` does not render using a `\u003cModal /\u003e`, so any other elements higher in the hierarchy have the potential to render over the top of your notifications.\n  - Any component you'd wish to have the ability to generate a toast will need to be wrapped with the `withButter` higher-order component (HOC).\n\n```javascript\nimport React, { useEffect } from 'react';\nimport { View, Text, Easing, StyleSheet } from 'react-native';\nimport ButteredToastProvider, { withButter } from 'react-native-buttered-toast';\n\nconst styles = StyleSheet\n  .create(\n    {\n      container: {\n        alignItems: 'center',\n        justifyContent: 'center',\n      },\n    },\n  );\n\n// XXX: The `withButter` HOC supplies the `makeToast` and `consumeToast` props, used to show and dismiss toasts respectively.\nconst App = ({ makeToast, consumeToast }) =\u003e {\n  useEffect(\n    () =\u003e {\n      makeToast(\n        ({ ...extraProps }) =\u003e (\n          \u003cText\n            {...extraProps}\n            children=\"I will be rendered as a draggable, dismissable, toast!\"\n          /\u003e\n        ),\n        {\n          // XXX: Allow swipe to dismiss.\n          dismissable: true,\n          // XXX: Automatically kill after two seconds.\n          lifespan: 2000,\n          // XXX: When the toast pops up, make it to bounce!\n          easing: Easing.bounce,\n        },\n      );\n    },\n  );\n  return (\n    \u003cView\n      style={[\n        StyleSheet.absoluteFill,\n        styles.container,\n      ]}\n    \u003e\n      \u003cText\n        children=\"This is an example.\"\n      /\u003e\n    \u003c/View\u003e\n  );\n};\n\nexport default ({ ...extraProps }) =\u003e {\n  const ButteryApp = withButter(\n    App,\n  );\n  return (\n    \u003cButteredToastProvider\u003e\n      \u003cButteryApp\n        {...extraProps}\n      /\u003e\n    \u003c/ButteredToastProvider\u003e\n  );\n};\n\n```\n\n## 📌 Props\n\n### `ButteredToastProvider`\n\nProperty | Type | Required | Default value | Description\n:--- | :--- | :--- | :--- | :---\npaddingBottom|number|no|30| Spacing to apply to the bottom of the toasts.\npaddingRight|number|no|10| Spacing to apply to the right of the toasts.\npaddingBetween|number|no|10| Spacing to apply between successive toasts.\nduration|number|no|500| Default amount of time to automatically consume (hide) a toast.\neasing|func|no|Easing.bounce| Easing function when automatically consuming a toast.\n-----\n\n### `makeToast` Options\n\nThe `makeToast` prop injected by the `ButteredToastProvider` accepts a React Element as the first argument, and an `options` argument as the last. These options default to:\n\n```javascript\n{\n  containerStyle: styles.containerStyle, // An empty styles object.\n  duration: 1200,\n  easing: Easing.bounce,\n  lifespan: -1, // Must be dismissed.\n  dismissable: true,\n}\n```\n\n## ✌️ License\n[MIT](https://opensource.org/licenses/MIT)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/cawfree\"\u003e\n    \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy @cawfree a coffee\" width=\"232\" height=\"50\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-native-buttered-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcawfree%2Freact-native-buttered-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-native-buttered-toast/lists"}