{"_id":"@allenfang/react-toastr","_rev":"3-009ea83feb1e48fd05174d1207798caa","name":"@allenfang/react-toastr","description":"React.js toastr component","dist-tags":{"latest":"2.8.2"},"versions":{"2.8.2":{"name":"@allenfang/react-toastr","version":"2.8.2","description":"React.js toastr component","main":"lib/index.js","files":["lib/","src/lib","AUTHORS","CHANGELOG.md"],"scripts":{"start":"react-scripts start","test":"react-scripts test --env=jsdom","eject":"react-scripts eject","pretest":"npm run lint","test:once":"cross-env CI=true npm test","build:app":"react-scripts build","clean":"rimraf lib","lint":"cross-env NODE_ENV=test eslint .","prebuild:lib":"npm run lint && npm run clean","build:lib":"cross-env NODE_ENV=production babel src/lib --out-dir lib","precommit:lib":"npm run build:lib","commit:lib":"git add -A && git commit -m 'chore(lib): compile from src/lib using babel'","precommit:app":"npm run build:app","commit:app":"git add -A && git commit -m 'docs: compile from src/app with react-scripts'","prerelease":"npm run commit:lib && npm run commit:app","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/AllenFang/react-toastr.git"},"keywords":["React.js","React","react-component","toastr","alert","toast","message","popup","jQuery"],"author":{"name":"tomchentw","email":"developer@tomchentw.com","url":"https://github.com/tomchentw"},"license":"MIT","bugs":{"url":"https://github.com/tomchentw/react-toastr/issues"},"homepage":"https://tomchentw.github.io/react-toastr/","devDependencies":{"babel-cli":"^6.14.0","babel-core":"^6.14.0","babel-eslint":"6.1.2","babel-plugin-lodash":"^3.2.9","babel-plugin-transform-flow-comments":"^6.8.0","babel-plugin-typecheck":"^3.9.0","babel-preset-es2015":"^6.14.0","babel-preset-react":"^6.11.1","babel-preset-react-app":"^0.2.1","babel-preset-stage-0":"^6.5.0","codeclimate-test-reporter":"^0.3.3","cross-env":"^3.1.1","eslint":"3.5.0","eslint-config-react-app":"0.2.1","eslint-plugin-flowtype":"2.18.1","eslint-plugin-import":"1.12.0","eslint-plugin-jsx-a11y":"2.2.2","eslint-plugin-react":"6.3.0","jquery":"^3.1.0","prismjs":"^1.5.1","raw-loader":"^0.5.1","react-addons-test-utils":"<15.4.0","react-github-fork-ribbon":"^0.4.4","react-scripts":"0.6.1","rimraf":"^2.5.4","standard-version":"^2.4.0"},"dependencies":{"classnames":"^2.2.5","element-class":"^0.2.2","lodash":"^4.16.1","react-addons-update":"^0.14.0 || <15.4.0","react-dom":"^0.14.0 || <15.4.0","react":"^0.14.0 || <15.4.0"},"contributors":[{"name":"tomchentw","email":"developer@tomchentw.com","url":"https://github.com/tomchentw"},{"name":"yfxie","email":"yfxie@me.com","url":"http://www.json.tw"}],"gitHead":"5f4613156e4fb95fa91acbc42b0d1d845f4eca39","_id":"@allenfang/react-toastr@2.8.2","_shasum":"0bef6585189e0571dd6bdfc4ef98bc9f9c47da0c","_from":".","_npmVersion":"2.11.3","_nodeVersion":"4.2.1","_npmUser":{"name":"allenfang","email":"ayu780129@hotmail.com"},"dist":{"shasum":"0bef6585189e0571dd6bdfc4ef98bc9f9c47da0c","tarball":"https://registry.npmjs.org/@allenfang/react-toastr/-/react-toastr-2.8.2.tgz","integrity":"sha512-RlD4RTWghz1beVN8zoh4b6xkJp3OEEb4UVEzny6v9lmlWRw1UeTIVYfSZIQhQDq2VE2Yp2NkAzW1aP/LrO/vdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjYda9xzJ9CcPJlWY0IRpVsXxHsiipK15I64bcehbqGAIhAOLGn822X6SvXVl0hR/QSdFH6INahiPuF95kCDRxwhJl"}]},"maintainers":[{"name":"allenfang","email":"ayu780129@hotmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/react-toastr-2.8.2.tgz_1481644766865_0.16763247270137072"}}},"readme":"# react-toastr\n> React.js toastr component\n\n[![Version][npm-image]][npm-url] [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-image]][codeclimate-url] [![Coverage][codeclimate-coverage-image]][codeclimate-coverage-url] [![Dependencies][gemnasium-image]][gemnasium-url] [![Gitter][gitter-image]][gitter-url]\n\n\n## Installation\n\n```sh\nnpm i --save react-toastr\n```\n\n\n## Demo\n\nStatic hosted [demo site][demo] on GitHub.\n\n\n## Example\n\nCheck [src/app][src/app] folder.\n\n\n## Usage\n\nThis module requires to be bundled with [webpack][webpack]/browserify and loads `react/addons` internally.  \nYou'll need to download animate.css from here [Animate @github](https://raw.github.com/daneden/animate.css/master/animate.css)\n\nLink to css for styles:\n\n```html\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css\">\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css\">\n```\n\nThen:\n\n```javascript\nvar ReactToastr = require(\"react-toastr\");\nvar {ToastContainer} = ReactToastr; // This is a React Element.\n// For Non ES6...\n// var ToastContainer = ReactToastr.ToastContainer;\nvar ToastMessageFactory = React.createFactory(ReactToastr.ToastMessage.animation);\n\n  // In a react component:\n  render () {\n    return (\n      <div>\n        <ToastContainer ref=\"container\"\n                        toastMessageFactory={ToastMessageFactory}\n                        className=\"toast-top-right\" />\n        <button onClick={this.addAlert}>GGininder</button>\n      </div>\n    );\n  }\n```\n\nHere's a list of React Elements:\n\n### ToastContainer\n\nThis is the container where all `ToastMessage` elements will go. Use it by retaining a [ref][react-ref] to publish a new **toast message**:\n\n```javascript\n  addAlert () {\n    this.refs.container.success(\n      \"Welcome welcome welcome!!\",\n      \"You are now home my friend. Welcome home my friend.\", {\n      timeOut: 30000,\n      extendedTimeOut: 10000\n    });\n    window.open(\"http://youtu.be/3SR75k7Oggg\");\n  }\n```\n\nor integrated with your [flux][flux] architecture?\n\n```javascript\n  componentDidMount: function() {\n    InInDerStore.addChangeListener(this.addAlert);\n  }\n```\n\n#### Options\n\nDirectly migrated from `toastr.js` library, and can be overrided via `props` in a React way:\n\n[`ToastContainer::getDefaultProps`](http://git.io/RagItA)\n\n##### Close Button\n\nThe close button on the toastr is an optional functionality.\n\n```javascript\n  closeButton:true\n```\n##### Time Out\n\nSet the time(in ms) after which the toastr message should automatically close.\n\n```javascript\n  timeOut:5000\n```\n##### Prevent Duplicates\n\nThis prevents duplicate messages from getting triggered.\n\n```javascript\n  preventDuplicates:true\n```\n\n#### Displaying HTML\n\nTo display HTML simply pass JSX instead of strings for title and message arguments:\n\n```javascript\nthis.refs.container.success(\n  <strong>I am a strong title</strong>,\n  <em>I am an emphasized message</em>\n});\n```\n\n### ToastMessage\n\nBase class for holding a toast message, it will not animate in and out during it's lifecycle.\nProvides **`ToastMessage.animation`** and `ToastMessage.jQuery` for your choice.\n\n#### Options\n\nDirectly migrated from `toastr.js` library, and can be overrided via `props` in a React way:\n\n* [`ToastMessage::getDefaultProps`](http://git.io/90CzSA)\n* [`ToastMessage.animation::getDefaultProps`](http://git.io/vU2sz)\n  Credits go to **@Janekk**\n* [`ToastMessage.jQuery::getDefaultProps`](http://git.io/YcbXvA)\n\n\n[npm-image]: https://img.shields.io/npm/v/react-toastr.svg?style=flat-square\n[npm-url]: https://www.npmjs.org/package/react-toastr\n\n[travis-image]: https://img.shields.io/travis/tomchentw/react-toastr.svg?style=flat-square\n[travis-url]: https://travis-ci.org/tomchentw/react-toastr\n[codeclimate-image]: https://img.shields.io/codeclimate/github/tomchentw/react-toastr.svg?style=flat-square\n[codeclimate-url]: https://codeclimate.com/github/tomchentw/react-toastr\n[codeclimate-coverage-image]: https://img.shields.io/codeclimate/coverage/github/tomchentw/react-toastr.svg?style=flat-square\n[codeclimate-coverage-url]: https://codeclimate.com/github/tomchentw/react-toastr\n[gemnasium-image]: https://img.shields.io/gemnasium/tomchentw/react-toastr.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/tomchentw/react-toastr\n[gitter-image]: https://badges.gitter.im/Join%20Chat.svg\n[gitter-url]: https://gitter.im/tomchentw/react-toastr?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\n\n[demo]: https://tomchentw.github.io/react-toastr/\n[src/app]: https://github.com/tomchentw/react-toastr/tree/master/src/app\n[webpack]: https://webpack.github.io/docs/tutorials/getting-started/\n[react-ref]: https://facebook.github.io/react/docs/more-about-refs.html\n[flux]: https://facebook.github.io/flux/docs/overview.html\n","maintainers":[{"name":"allenfang","email":"ayu780129@hotmail.com"}],"time":{"modified":"2022-06-12T14:33:46.996Z","created":"2016-12-13T15:59:27.121Z","2.8.2":"2016-12-13T15:59:27.121Z"},"homepage":"https://tomchentw.github.io/react-toastr/","keywords":["React.js","React","react-component","toastr","alert","toast","message","popup","jQuery"],"repository":{"type":"git","url":"git+https://github.com/AllenFang/react-toastr.git"},"contributors":[{"name":"tomchentw","email":"developer@tomchentw.com","url":"https://github.com/tomchentw"},{"name":"yfxie","email":"yfxie@me.com","url":"http://www.json.tw"}],"author":{"name":"tomchentw","email":"developer@tomchentw.com","url":"https://github.com/tomchentw"},"bugs":{"url":"https://github.com/tomchentw/react-toastr/issues"},"license":"MIT","readmeFilename":"README.md"}