{"id":19570321,"url":"https://github.com/manjushsh/mui-simple-toast","last_synced_at":"2026-06-19T10:31:48.197Z","repository":{"id":65347950,"uuid":"560388037","full_name":"manjushsh/mui-simple-toast","owner":"manjushsh","description":"Simplified MUI Toast","archived":false,"fork":false,"pushed_at":"2023-10-18T12:54:56.000Z","size":431,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T11:55:32.145Z","etag":null,"topics":["material-toast","material-ui","mui","toast"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mui-simple-toast","language":"TypeScript","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/manjushsh.png","metadata":{"files":{"readme":"README.md","changelog":"history.txt","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":"2022-11-01T11:46:04.000Z","updated_at":"2022-12-24T03:28:40.000Z","dependencies_parsed_at":"2025-01-09T02:51:17.473Z","dependency_job_id":"eb870f81-e34b-4e84-90fe-74a5be2b9974","html_url":"https://github.com/manjushsh/mui-simple-toast","commit_stats":{"total_commits":61,"total_committers":4,"mean_commits":15.25,"dds":0.4426229508196722,"last_synced_commit":"d20fbf31ac7d418952e760caeedf6760a7506378"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/manjushsh/mui-simple-toast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manjushsh%2Fmui-simple-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manjushsh%2Fmui-simple-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manjushsh%2Fmui-simple-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manjushsh%2Fmui-simple-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manjushsh","download_url":"https://codeload.github.com/manjushsh/mui-simple-toast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manjushsh%2Fmui-simple-toast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34528134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"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":["material-toast","material-ui","mui","toast"],"created_at":"2024-11-11T06:14:40.532Z","updated_at":"2026-06-19T10:31:47.949Z","avatar_url":"https://github.com/manjushsh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mui-simple-toast - Simplified toaster/snackbar for MUI\nA Simpler MUI Toast.\nThis reduces code to single line compared to Actual Toast Code from MUI\n```\n\u003cSnackbar open={open} autoHideDuration={6000} onClose={handleClose}\u003e\n  \u003cAlert onClose={handleClose} severity=\"success\" sx={{ width: '100%' }}\u003e\n    This is a success message!\n  \u003c/Alert\u003e\n\u003c/Snackbar\u003e\n```\n\nto\n\n```\n\u003cMUISimpleToast toast={toast} setToast={setToast} /\u003e\n```\n\n# [Demo](https://codesandbox.io/s/mui-simple-toast-g5ei8i?file=/src/index.tsx)\n\n## If install fails, try running\n`npm i --legacy-peer-deps`\n\n# How to use?\n\nYou can set toaster using ```seToast```\n\nExample on API Call:\n```\nfetch(url)\n.then(() =\u003e setToast({\n    show: true,\n    type: 'success',\n    message: 'Success!',\n}))\n.catch(err =\u003e setToast({\n    show: true,\n    type: 'error',\n    message: err?.message || '',\n    }))\n\n```\n\n ### In your component/Root component, \n\n```\nimport React, { useEffect, useState } from 'react';\nimport MUISimpleToast, { defaultToast } from 'mui-simple-toast'\nimport './App.css';\n\nfunction App() {\n\n  const  [toast, setToast] = useState(defaultToast)\n\n  useEffect(() =\u003e {\n    setInterval(() =\u003e {\n        setToast({\n          show: true,\n          type: 'success',\n          message: 'Welcome to Simpler toast!',\n        })\n    }, 3000)\n  }, [])\n\n  return (\n      \u003cdiv className=\"App\"\u003e\n        \u003ch1\u003eHi There. Can you see some toast?\u003c/h1\u003e\u003e\n        \u003cMUISimpleToast toast={toast} setToast={setToast} /\u003e\n      \u003c/div\u003e\n  );\n}\n\nexport default App;\n\n```\n\nIn return method of component, add ```\u003cMUISimpleToast toast={toast} setToast={setToast} /\u003e```\n\n\n\n### Or you can use Context API\n\nin index.js\n\n```\nimport React, { createContext, useState } from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\nimport './index.css';\nimport { defaultToast } from 'mui-simple-toast';\n\n/** Create a Context for Toast Wrapper*/\nexport const ToastContext = createContext(defaultToast)\nconst ToastProvider = ({ children }: any) =\u003e {\n  // ** States\n  const [toast, updateToast] = useState(defaultToast)\n  const setToast = (toastData: any) =\u003e updateToast({ ...toast, ...toastData })\n  const values = {\n    toast,\n    setToast,\n  }\n  return \u003cToastContext.Provider value={values}\u003e{children}\u003c/ToastContext.Provider\u003e\n}\n\nroot.render(\n  \u003cReact.StrictMode\u003e\n    /** Wrap your Root component with Context Provider */\n    \u003cToastProvider\u003e\n      \u003cApp /\u003e\n    \u003c/ToastProvider\u003e\n  \u003c/React.StrictMode\u003e\n);\n\n```\n\nIn your App/ Child Component, add\n\n```\nconst { toast, setToast }: any = useContext(ToastContext)\n\n```\n\nand in return of same component,\n\n```\n\u003cMUISimpleToast toast={toast} setToast={setToast} /\u003e\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanjushsh%2Fmui-simple-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanjushsh%2Fmui-simple-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanjushsh%2Fmui-simple-toast/lists"}