{"id":13755473,"url":"https://github.com/trendmicro-frontend/react-modal","last_synced_at":"2026-03-06T14:34:18.795Z","repository":{"id":57167644,"uuid":"76373473","full_name":"trendmicro-frontend/react-modal","owner":"trendmicro-frontend","description":"React Modal component","archived":false,"fork":false,"pushed_at":"2023-09-22T14:10:40.000Z","size":3343,"stargazers_count":19,"open_issues_count":2,"forks_count":5,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-09-04T14:43:41.410Z","etag":null,"topics":["modal","react"],"latest_commit_sha":null,"homepage":"https://trendmicro-frontend.github.io/react-modal","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/trendmicro-frontend.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-13T15:51:24.000Z","updated_at":"2024-02-08T19:56:43.000Z","dependencies_parsed_at":"2024-01-17T15:20:54.218Z","dependency_job_id":null,"html_url":"https://github.com/trendmicro-frontend/react-modal","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/trendmicro-frontend/react-modal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendmicro-frontend","download_url":"https://codeload.github.com/trendmicro-frontend/react-modal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-modal/sbom","scorecard":{"id":897973,"data":{"date":"2025-08-11","repo":{"name":"github.com/trendmicro-frontend/react-modal","commit":"20e1518f51adad849e2a2fa67665c6f5cbbd9009"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T14:27:35.823Z","repository_id":57167644,"created_at":"2025-08-24T14:27:35.823Z","updated_at":"2025-08-24T14:27:35.823Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30180737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["modal","react"],"created_at":"2024-08-03T10:00:54.798Z","updated_at":"2026-03-06T14:34:18.737Z","avatar_url":"https://github.com/trendmicro-frontend.png","language":"JavaScript","funding_links":[],"categories":["Trend Micro"],"sub_categories":["React Components"],"readme":"# react-modal [![build status](https://travis-ci.org/trendmicro-frontend/react-modal.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-modal) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-modal/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-modal?branch=master)\n\n[![NPM](https://nodei.co/npm/@trendmicro/react-modal.png?downloads=true\u0026stars=true)](https://nodei.co/npm/@trendmicro/react-modal/)\n\nReact Modal\n\nDemo: https://trendmicro-frontend.github.io/react-modal\n\n## Installation\n\n1. Install the latest version of [react](https://github.com/facebook/react) and [react-modal](https://github.com/trendmicro-frontend/react-modal):\n\n  ```\n  npm install --save react @trendmicro/react-modal\n  ```\n\n2. At this point you can import `@trendmicro/react-modal` and its styles in your application as follows:\n\n  ```js\n  import Modal from '@trendmicro/react-modal';\n\n  // Be sure to include styles at some point, probably during your bootstraping\n  import '@trendmicro/react-modal/dist/react-modal.css';\n  ```\n  \n## Recommended Setup\n\nCreate a common components directory including both `Buttons` and `Modal` components, as shown below:\n```\ncomponents/\n  Buttons/\n    index.js\n  Modal/\n    index.js\n```\n\n**components/Buttons/index.js**\n```js\nimport '@trendmicro/react-buttons/dist/react-buttons.css';\n\nexport { Button, ButtonGroup, ButtonToolbar } from '@trendmicro/react-buttons';\n```\n\n**components/Modal/index.js**\n```js\nimport '@trendmicro/react-modal/dist/react-modal.css';\nimport Modal from '@trendmicro/react-modal';\n\nexport default Modal;\n```\n\nThen, import `Modal` component in your code:\n```js\nimport Modal from './components/Modal';\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport { Button } from './components/Buttons';\nimport Modal from './components/Modal';\n\nexport default ({ size = 'sm', closeModal, ...props }) =\u003e (\n    \u003cModal {...props} size={size} onClose={closeModal}\u003e\n        \u003cModal.Header\u003e\n            \u003cModal.Title\u003e\n                Modal Title\n            \u003c/Modal.Title\u003e\n        \u003c/Modal.Header\u003e\n        \u003cModal.Body padding\u003e\n            Modal Body\n        \u003c/Modal.Body\u003e\n        \u003cModal.Footer\u003e\n            \u003cButton\n                btnStyle=\"primary\"\n                onClick={closeModal}\n            \u003e\n                Save\n            \u003c/Button\u003e\n            \u003cButton\n                btnStyle=\"default\"\n                onClick={closeModal}\n            \u003e\n                Close\n            \u003c/Button\u003e\n        \u003c/Modal.Footer\u003e\n    \u003c/Modal\u003e\n);\n```\n\n## Examples\n\n### Prevent Body From Scrolling\n\nYou can create a ModalWrapper component that changes the body style on open and close.\n\n```js\nimport React, { PureComponent } from 'react';\nimport Modal from './components/Modal';\n\nlet bodyStyle = null;\n\nclass ModalWrapper extends PureComponent {\n    static propTypes = {\n        ...Modal.propTypes\n    };\n\n    static defaultProps = {\n        ...Modal.defaultProps\n    };\n\n    componentWillReceiveProps(nextProps) {\n        if (nextProps.show !== this.props.show) {\n            if (nextProps.show) {\n                this.changeBodyStyle();\n            } else {\n                this.restoreBodyStyle();\n            }\n        }\n    }\n\n    componentDidMount() {\n        this.changeBodyStyle();\n    }\n\n    componentWillUnmount() {\n        this.restoreBodyStyle();\n    }\n\n    changeBodyStyle() {\n        if (bodyStyle) {\n            return;\n        }\n        // Prevent body from scrolling when a modal is opened\n        const body = document.querySelector('body');\n        bodyStyle = {\n            overflowY: body.style.overflowY\n        };\n        body.style.overflowY = 'hidden';\n    }\n\n    restoreBodyStyle() {\n        if (bodyStyle) {\n            const body = document.querySelector('body');\n            body.style.overflowY = bodyStyle.overflowY;\n            bodyStyle = null;\n        }\n    }\n\n    render() {\n        const { onClose, ...props } = this.props;\n\n        return (\n            \u003cModal\n                {...props}\n                onClose={() =\u003e {\n                    this.restoreBodyStyle();\n                    onClose();\n                }}\n            /\u003e\n        );\n    }\n}\n\nModalWrapper.Overlay = Modal.Overlay;\nModalWrapper.Content = Modal.Content;\nModalWrapper.Header = Modal.Header;\nModalWrapper.Title = Modal.Title;\nModalWrapper.Body = Modal.Body;\nModalWrapper.Footer = Modal.Footer;\n\nexport default ModalWrapper;\n```\n\n## API\n\n### Properties\n\nName | Type | Default | Description\n:--- | :--- | :------ | :----------\nonClose | Function | | A callback fired on clicking the overlay or the close button (x).\nshow | Boolean | true | Whether the modal is visible.\nshowCloseButton | Boolean | true | Whether the close button (x) is visible.\nshowOverlay | Boolean | true | Display an overlay in the background. Defaults to `true`.\ndisableOverlayClick | Boolean | false | Don't close the modal on clicking the overlay. Defaults to `false`.\noverlayClassName | String | | className to assign to modal overlay.\noverlayStyle | Object | | style to assign to modal overlay.\nsize | String | '' | One of: 'xs', 'sm', 'md', 'lg', 'extra-small', 'small', 'medium', 'large', or an empty string. Defaults to empty string that will automatically resize to fit contents.\n\n### Size\n\nSize | Value | Dimension\n:--- | :---- | :--------\nAuto | '' | 400px (minimum width)\nExtra Small | 'xs', 'extra-small' | 400px (fixed width) x 240 px (minimum height)\nSmall | 'sm', 'small' | 544px (fixed width) x 304 px (minimum height)\nMedium | 'md', 'medium' | 688px (fixed width) x 304 px (minimum height)\nLarge | 'lg', 'large' | 928px (fixed width) x 304 px (minimum height)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendmicro-frontend%2Freact-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-modal/lists"}