{"id":13436284,"url":"https://github.com/yuanyan/boron","last_synced_at":"2025-05-15T03:02:56.911Z","repository":{"id":29931889,"uuid":"33478061","full_name":"yuanyan/boron","owner":"yuanyan","description":"A collection of dialog animations with React.js","archived":false,"fork":false,"pushed_at":"2019-10-09T19:51:02.000Z","size":1963,"stargazers_count":1477,"open_issues_count":34,"forks_count":154,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-15T00:48:15.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://yuanyan.github.io/boron","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/yuanyan.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":"2015-04-06T11:03:36.000Z","updated_at":"2025-04-04T13:36:28.000Z","dependencies_parsed_at":"2022-09-07T06:11:05.704Z","dependency_job_id":null,"html_url":"https://github.com/yuanyan/boron","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanyan%2Fboron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanyan%2Fboron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanyan%2Fboron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanyan%2Fboron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuanyan","download_url":"https://codeload.github.com/yuanyan/boron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264737,"owners_count":22041789,"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":[],"created_at":"2024-07-31T03:00:46.221Z","updated_at":"2025-05-15T03:02:56.854Z","avatar_url":"https://github.com/yuanyan.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","JavaScript","UI Components","Demos","\u003csummary\u003eUI Components\u003c/summary\u003e","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Uncategorized","Overlay","JBoss Data Virtualization"],"readme":"Boron  [![npm version](https://badge.fury.io/js/boron.svg)](http://badge.fury.io/js/boron)\n=====\n\n[![Pair on this](https://tf-assets-staging.s3.amazonaws.com/badges/thinkful_repo_badge.svg)](http://start.thinkful.com/react/?utm_source=github\u0026utm_medium=badge\u0026utm_campaign=boron)\n\nA collection of dialog animations with React.js.\n\n* React 0.14+ Use `boron 0.2`\n* React 0.12+ Use `boron 0.1`\n\n## Demo \u0026 Examples\n\nLive demo: [yuanyan.github.io/boron](http://yuanyan.github.io/boron/)\n\nTo build the examples locally, run:\n\n```\nnpm install\ngulp dev\n```\n\nThen open [`localhost:9999`](http://localhost:9999) in a browser.\n\n## Installation\n\nThe easiest way to use `boron` is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), etc).\n\nYou can also use the standalone build by including `dist/boron.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable.\n\n```\nnpm install boron --save\n```\n\n## Usage\n\n``` javascript\nvar Modal = require('boron/DropModal');\nvar Example = React.createClass({\n    showModal: function(){\n        this.refs.modal.show();\n    },\n    hideModal: function(){\n        this.refs.modal.hide();\n    },\n\n    callback: function(event){\n        console.log(event);\n    },\n\n    render: function() {\n        return (\n            \u003cdiv\u003e\n                \u003cbutton onClick={this.showModal}\u003eOpen\u003c/button\u003e\n                \u003cModal ref=\"modal\" keyboard={this.callback}\u003e\n                    \u003ch2\u003eI am a dialog\u003c/h2\u003e\n                    \u003cbutton onClick={this.hideModal}\u003eClose\u003c/button\u003e\n                \u003c/Modal\u003e\n            \u003c/div\u003e\n        );\n    }\n});\n```\n\n## Props\n\n* className - Add custom class name.\n* keyboard - Receive a callback function or a boolean to choose to close the modal when escape key is pressed.\n* backdrop - Includes a backdrop element.\n* closeOnClick - Close the backdrop element when clicked.\n* onShow - Show callback.\n* onHide - Hide callback. Argument is the source of the hide action, one of:\n * hide - hide() method is the cause of the hide.\n * toggle - toggle() method is the cause of the hide\n * keyboard - keyboard (escape key) is the cause of the hide\n * backdrop - backdrop click is the cause of the hide\n * [any] - custom argument passed by invoking code into the hide() method when called directly.\n* modalStyle - CSS styles to apply to the modal\n* backdropStyle - CSS styles to apply to the backdrop\n* contentStyle - CSS styles to apply to the modal's content\n\nNote: If the hide() method is called directly, a custom source string can be\npassed as the argument, as noted above. For example, this might be useful if\nif multiple actions could cause the hide and it was desirable to know which of those\nactions was the trigger for the given onHide callback).\n\n# Custom Styles\nObjects consisting of CSS properties/values can be passed as props to the Modal component.\nThe values for the CSS properties will either add new properties or override the default property value set for that Modal type.\n\nModal with 80% width:\n``` javascript\nvar Modal = require('boron/ScaleModal');\n\n// Style object\nvar modalStyle = {\n    width: '80%'\n};\n\nvar Example = React.createClass({\n    showModal: function(){\n        this.refs.modal.show();\n    },\n    hideModal: function(){\n        this.refs.modal.hide();\n    },\n    render: function() {\n        return (\n            \u003cdiv\u003e\n                \u003cbutton onClick={this.showModal}\u003eOpen\u003c/button\u003e\n                \u003cModal ref=\"modal\" modalStyle={modalStyle}\u003e\n                    \u003ch2\u003eI am a dialog\u003c/h2\u003e\n                    \u003cbutton onClick={this.hideModal}\u003eClose\u003c/button\u003e\n                \u003c/Modal\u003e\n            \u003c/div\u003e\n        );\n    }\n});\n```\n\nRed backdrop with a blue modal, rotated at 45 degrees:\n``` javascript\nvar Modal = require('boron/FlyModal');\n\n// Individual styles for the modal, modal content, and backdrop\nvar modalStyle = {\n    transform: 'rotate(45deg) translateX(-50%)',\n};\n\nvar backdropStyle = {\n    backgroundColor: 'red'\n};\n\nvar contentStyle = {\n    backgroundColor: 'blue',\n    height: '100%'\n};\n\nvar Example = React.createClass({\n    showModal: function(){\n        this.refs.modal.show();\n    },\n    hideModal: function(){\n        this.refs.modal.hide();\n    },\n    render: function() {\n        return (\n            \u003cdiv\u003e\n                \u003cbutton onClick={this.showModal}\u003eOpen\u003c/button\u003e\n                \u003cModal ref=\"modal\" modalStyle={modalStyle} backdropStyle={backdropStyle} contentStyle={contentStyle}\u003e\n                    \u003ch2\u003eI am a dialog\u003c/h2\u003e\n                    \u003cbutton onClick={this.hideModal}\u003eClose\u003c/button\u003e\n                \u003c/Modal\u003e\n            \u003c/div\u003e\n        );\n    }\n});\n```\n\n\n## Modals\n\n* DropModal\n* FadeModal\n* FlyModal\n* OutlineModal\n* ScaleModal\n* WaveModal\n\n## Browser Support\n\n![IE](https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png)\n--- | --- | --- | --- | --- |\nIE 10+ ✔ | Chrome 4.0+ ✔ | Firefox 16.0+ ✔ | Opera 15.0+ ✔ | Safari 4.0+ ✔ |\n\n## License\n\nBoron is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanyan%2Fboron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuanyan%2Fboron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanyan%2Fboron/lists"}