{"id":25802112,"url":"https://github.com/valisoftworks/react-apply-darkmode","last_synced_at":"2026-05-03T17:31:36.967Z","repository":{"id":57332863,"uuid":"302834642","full_name":"valisoftworks/react-apply-darkmode","owner":"valisoftworks","description":"Drop-in dark mode for React apps.","archived":false,"fork":false,"pushed_at":"2021-10-23T08:21:13.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T08:57:12.542Z","etag":null,"topics":["component","dark-mode","dark-theme","darkreader","react","react-component"],"latest_commit_sha":null,"homepage":"https://www.valisoft.net/blog/2020-10-22","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/valisoftworks.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":"2020-10-10T06:45:16.000Z","updated_at":"2021-10-23T08:21:17.000Z","dependencies_parsed_at":"2022-09-12T00:01:29.024Z","dependency_job_id":null,"html_url":"https://github.com/valisoftworks/react-apply-darkmode","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/valisoftworks/react-apply-darkmode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valisoftworks%2Freact-apply-darkmode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valisoftworks%2Freact-apply-darkmode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valisoftworks%2Freact-apply-darkmode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valisoftworks%2Freact-apply-darkmode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valisoftworks","download_url":"https://codeload.github.com/valisoftworks/react-apply-darkmode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valisoftworks%2Freact-apply-darkmode/sbom","scorecard":{"id":915311,"data":{"date":"2025-08-11","repo":{"name":"github.com/valisoftworks/react-apply-darkmode","commit":"d3baf752ecc94918e966dc20ee44357364f579d2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/6 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":"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":"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":"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":"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":"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":"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"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 2 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-24T20:44:40.022Z","repository_id":57332863,"created_at":"2025-08-24T20:44:40.023Z","updated_at":"2025-08-24T20:44:40.023Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["component","dark-mode","dark-theme","darkreader","react","react-component"],"created_at":"2025-02-27T16:46:46.124Z","updated_at":"2026-05-03T17:31:36.945Z","avatar_url":"https://github.com/valisoftworks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-apply-darkmode\n\nApply dark mode directly to your React website or web app in one step; no manual\ntheming required! Reduce component complexity and CSS while still delivering a\nhigh-quality dark mode experience that your users will greatly appreciate.\n\n`react-apply-darkmode` is a wrapper around\n[@darkreader/darkreader](https://github.com/darkreader/darkreader)'s ES6 API,\nallowing you to control the dark mode functionality it provides with React\nbindings. Your users **do NOT** need to have the Dark Reader extension installed\nfor dark mode to work.\n\n## Installation\n\n`npm i react-apply-darkmode`\n\n`yarn add react-apply-darkmode`\n\n## Usage\n\nUse the `Interpolator` component to wrap your app at the top level:\n\n##### `App.js`\n\n```javascript\nimport {Interpolator} from 'react-apply-darkmode';\n\nexport default function App() {\n  return (\n    \u003cInterpolator\n      appearance='dark'\n      watchSystem={false}\n      filter={{brightness: 100, contrast: 90, sepia: 10}}\u003e\n      \u003cMyApp /\u003e\n    \u003c/Interpolator\u003e\n  );\n}\n```\n\n## Props\n\n| Prop        | Values                                                  | Purpose                                                                                                                                                                                                                                         |\n| ----------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| appearance  | `'dark'`, `'light'`, or `undefined`                     | `Interpolator` will apply this theme to your site; this is your manual control for dark mode. `appearance` is `undefined` by default; if `undefined`, no theme will be applied on mount (you can still use `watchSystem` to control dark mode). |\n| watchSystem | `true` or `false`                                       | Apply dark mode based on the device's color scheme. This will override `appearance` if you've set it. `watchSystem` defaults to `false`. Not all browsers are supported; see Notes for more.                                                    |\n| filter      | `{brightness: number, contrast: number, sepia: number}` | Dark mode's appearance filter. You can supply any number of these values or none at all; default is 100 brightness, 90 contrast, and 10 sepia.                                                                                                  |\n\n## Notes\n\n- `Interpolator` (or a component that utilizes it) should always your top-level\n  component, such as in `App` in `App.js` if using Create React App or via\n  `wrapRootElement` if using Gatsby. This will ensure that dark mode is ready\n  before your components render, preventing undesirable flashes.\n\n  **IMPORTANT:** If using Gatsby, you only need to define `wrapRootElement` with\n  `Interpolator` for Gatsby's browser API via `gatsby-browser.js`. Don't use\n  `Interpolator` in `gatsby-ssr.js` or anywhere lower in the DOM tree; Dark\n  Reader depends on `window` and `document` which are unavailable during SSR\n  prerendering (you'll get build errors!).\n\n- `watchSystem` relies on the `prefers-color-scheme` CSS media feature, which\n  some browsers may not support; privacy settings can also influence the value\n  of `prefers-color-scheme`.\n\n  Mozilla has compiled a list of compatible browsers\n  [here](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme#Browser_compatibility).\n\n## Tips\n\n### Persistence\n\nYou will need to implement your own solution to persist\ndark mode across browser sessions by changing values supplied to the\n`appearance` prop. \n\nSetting status as a key-value pair in `localStorage` is most appropriate, although you may elect to incorporate this into your `redux` store.\n\n### Colors\n\n`react-apply-darkmode` will tone down bright colors and reduce contrast. \n\nThe extremity of this adjustment can range from subtle to intense; minor changes to the hue can have a large impact on the final result.\n\nTry to stick to subtler filter options to avoid making color-coding bothersome. Sometimes, good enough is good enough!   \n\n### Images\n\nMaximize transparency of image assets! For the most part, `react-apply-darkmode` will not invert\nimages. \n\nMake sure your images have transparent\nbackgrounds and transparency where color isn't absolutely needed, especially for logos.\n\n### Theming Conflicts\n\nTry to avoid using another dark mode theming solution alongside `react-apply-darkmode`\n(e.g. with React context/providers, CSS classes, or another package). \n\nThis can\ncause undesirable flickering effects when solutions try to compensate for each\nother's changes.\n\n### Component Library Issues\n\nCertain UI component libraries don't work well with `react-apply-darkmode`.\n\nInstalling the Dark Reader browser extension\n(Chrome or Firefox, for best results) and exploring a component library's site\nwill give you a good idea of how well it works.\n\nYou can view a (incomplete) list of issue libraries\n[here](https://github.com/valisoftpdx/react-apply-darkmode/wiki/Issue-Component-Libraries).\n\n## Credits\n\nThis package was created by [Victor Li](https://github.com/victorli08), an avid\nand longtime user of the Dark Reader extension.\n\n`react-apply-darkmode` is made possible by the open source\n[@darkreader](https://github.com/darkreader/darkreader) project. If you like this\npackage, please give a shoutout to Dark Reader's developers and consider\nsponsoring them!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalisoftworks%2Freact-apply-darkmode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalisoftworks%2Freact-apply-darkmode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalisoftworks%2Freact-apply-darkmode/lists"}