{"id":13436354,"url":"https://github.com/xeodou/react-crouton","last_synced_at":"2025-08-19T08:12:38.500Z","repository":{"id":20854873,"uuid":"24141550","full_name":"xeodou/react-crouton","owner":"xeodou","description":"A message component for reactjs","archived":false,"fork":false,"pushed_at":"2018-01-23T18:48:24.000Z","size":456,"stargazers_count":143,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T04:55:43.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://xeodou.github.io/react-crouton/","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/xeodou.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":"2014-09-17T11:16:24.000Z","updated_at":"2025-07-08T21:43:15.000Z","dependencies_parsed_at":"2022-08-21T20:40:50.653Z","dependency_job_id":null,"html_url":"https://github.com/xeodou/react-crouton","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xeodou/react-crouton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeodou%2Freact-crouton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeodou%2Freact-crouton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeodou%2Freact-crouton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeodou%2Freact-crouton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xeodou","download_url":"https://codeload.github.com/xeodou/react-crouton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeodou%2Freact-crouton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271121168,"owners_count":24702723,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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-07-31T03:00:47.082Z","updated_at":"2025-08-19T08:12:38.474Z","avatar_url":"https://github.com/xeodou.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","Awesome React","JavaScript","UI Components","Demos"],"sub_categories":["Uncategorized","Tools","Notification"],"readme":"# React-Crouton [![Build Status](https://travis-ci.org/xeodou/react-crouton.svg?branch=master)](https://travis-ci.org/xeodou/react-crouton)\n\n\u003e A message component for reactjs\n\n[Live Demo](http://xeodou.github.io/react-crouton)\n\n## Getting Started\n\nInstall via [npm](http://npmjs.org/react-crouton)\n\n```shell\n   npm i react-crouton --save-dev\n```\n\n## Usage\n\n```Javascript\nvar Crouton = require('react-crouton')\n\nvar data = {\n    id: Date.now(),\n    type: 'error',\n    message: 'Hello React-Crouton',\n    autoMiss: true || false,\n    onDismiss: listener,\n    buttons: [{\n        name: 'close',\n        listener: function() {\n\n        }\n    }],\n    hidden: false,\n    timeout: 2000\n}\n\n\u003cCrouton\n    id={data.id}\n    type={data.type}\n    message={data.message}\n    onDismiss={data.onDismiss}\n    buttons={data.buttons}\n    hidden={data.hidden}\n    timeout={data.timeout}\n    autoMiss={data.autoMiss}\u003e\n// You can render child component here\n// \u003cChildComponent /\u003e\n\u003c/Crouton\u003e\n\n```\n\n## Options\n\n**id** required, every message need an unique id.\n\ntype: `number`\n\n**message** required, the message what you want show.\n\ntype: `string` || `array`\n\nexample:\n\n```\nmessage: 'Hello React-Crouton'\nmessage: ['Hello', 'React', '-', 'Crouton']\n```\n\n**type** required, define what type message you want to define.\n\ntype: `string`\n\n**hidden** optional, control this property to show or hidden crouton.\n\ntype: `boolean`, default is `false`\n\n**buttons** optional, define the buttons that you want show to the user.\n\ntype: `string` || `array`\n\nexample:\n\n```\nbuttons: 'close'\nbutons: [{\n    name: 'close'\n}]\nbutons: [{\n    name: 'close',\n    listener: function() {\n        console.log('close button clicked.')\n    }\n}]\nbutons: [{\n    name: 'close',\n    className: 'custom class name',\n    listener: function() {\n        console.log('close button clicked.')\n    }\n}]\n```\n\n**autoMiss** optional, crouton will auto missed if set this propterty, default is true.\n\ntype: `boolean`\n\n**timeout** optional, set how long (ms) to auto dismiss the crouton.\n\ntype: `number`, default is `2000` ms (2 seconds)\n\n**onDismiss** optional, crouton will invoke this listener when it dismissed.\n\ntype: `function`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeodou%2Freact-crouton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxeodou%2Freact-crouton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeodou%2Freact-crouton/lists"}