{"id":30754193,"url":"https://github.com/sdgluck/react-z-index","last_synced_at":"2025-09-04T09:08:19.428Z","repository":{"id":57347907,"uuid":"71055851","full_name":"sdgluck/react-z-index","owner":"sdgluck","description":":globe_with_meridians: Easily manage global component z-index","archived":false,"fork":false,"pushed_at":"2019-01-16T13:49:37.000Z","size":53,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-28T00:58:13.912Z","etag":null,"topics":["react","zindex-components","zindex-style","zindex-values"],"latest_commit_sha":null,"homepage":"http://sdgluck.jsbin.com/quzifep/1/edit?html,js,output","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/sdgluck.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":"2016-10-16T14:33:15.000Z","updated_at":"2021-04-24T19:56:35.000Z","dependencies_parsed_at":"2022-08-28T03:01:49.268Z","dependency_job_id":null,"html_url":"https://github.com/sdgluck/react-z-index","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sdgluck/react-z-index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdgluck%2Freact-z-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdgluck%2Freact-z-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdgluck%2Freact-z-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdgluck%2Freact-z-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdgluck","download_url":"https://codeload.github.com/sdgluck/react-z-index/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdgluck%2Freact-z-index/sbom","scorecard":{"id":807044,"data":{"date":"2025-08-11","repo":{"name":"github.com/sdgluck/react-z-index","commit":"d5126be72958746c4426d831622a7a0ba5c60fa4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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 0/30 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"Vulnerabilities","score":0,"reason":"28 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T12:04:42.200Z","repository_id":57347907,"created_at":"2025-08-23T12:04:42.200Z","updated_at":"2025-08-23T12:04:42.200Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273581224,"owners_count":25131393,"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-09-04T02:00:08.968Z","response_time":61,"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":["react","zindex-components","zindex-style","zindex-values"],"created_at":"2025-09-04T09:07:01.340Z","updated_at":"2025-09-04T09:08:19.417Z","avatar_url":"https://github.com/sdgluck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-z-index\n\n\u003e :globe_with_meridians: Easily manage global component z-index\n\nMade with ❤ at \u003ca href=\"http://www.twitter.com/outlandish\"\u003e@outlandish\u003c/a\u003e\n\n\u003ca href=\"http://badge.fury.io/js/react-z-index\"\u003e\u003cimg alt=\"npm version\" src=\"https://badge.fury.io/js/react-z-index.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"http://standardjs.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg\" /\u003e\u003c/a\u003e\n\nTakes the pain out of managing component zIndex across your application! :heart_eyes:\n\n[Check out an example on JSBin](http://sdgluck.jsbin.com/quzifep/1/edit?html,js,output).\n\n## Features\n\n- Manage zIndex values in one place\n- Dynamically set the zIndex of components\n- Optionally warns you if a zIndex value is used more than once\n- Component or decorator interface\n- Add new zIndex values with ease\n- Create zIndex values...\n    - automatically; generate unique and ordered zIndex values, or\n    - manually; define your own zIndex values entirely, or\n    - both!\n    \nNote: `react-z-index` does not override [stacking contexts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context).\n\n## Install\n\n```sh\nnpm i --save react-z-index\n```\n\n```sh\nyarn add react-z-index\n```\n\n## Import\n\nThe library uses ES2015 features so should be used in conjunction with Babel and a bundler for use within the browser environment, e.g. Browserify or Webpack.\n\n```js\n// ES2015\nimport ZIndex from 'react-z-index' // component, util\nimport { zIndex } from 'react-z-index' // decorator\n```\n\n```js\n// CommonJS\nvar ZIndex = require('react-z-index')\nvar zIndex = require('react-z-index/decorator')\n```\n\n## API\n\n### `ZIndex.setVars(vars[, opts])`\n\nOptionally initialise `react-z-index` with a map of names to zIndex values.\n\n- __vars__ {Object|Array} Map of names to zIndex values or array of names\n- [__opts.start__] {Number} _(optional)_ Start zIndex for generated values (default: `10`)\n- [__opts.step__] {Number} _(optional)_ Generated index step (default: `10`)\n- [__opts.warnDuplicate__] {Boolean} _(optional)_ Warn if zIndex value used more than once (default: `true`)\n\nVars are made available at `ZIndex.vars`, e.g. `ZIndex.vars.Modal`.\n\n```js\n// Explicit zIndex values\nZIndex.setVars({\n  Modal: 300,\n  Overlay: 200,\n  Dropdown: 100\n})\n\n// Generated zIndex values\n// First element is highest, last element is lowest\n// Define explicit indexes using array\nZIndex.setVars([\n  'Modal', //=\u003e 30\n  'Overlay', //=\u003e 20\n  ['Dropdown', 15], //=\u003e 15\n  'Backdrop' //=\u003e 10\n])\n\n// e.g. suppress duplicate zIndex warning\nZIndex.setVars([\n  ['ErrorModal', 100],\n  ['WarningModal', 100]\n], {\n  warnDuplicate: false\n})\n```\n\n### `ZIndex.setVar(name, value)`\n\nSet a new zIndex value.\n\n- __name__ {String} Name of the value\n- __value__ {Number} zIndex integer\n\nVars should be treated as constants, so this cannot be used to update the value of a predefined var.\n\n```js\nZIndex.setVar('Modal', 400)\n```\n\n## Component\n\nEach component should use exactly one of the following props:\n\n- __index__ {String|Number|Function} Set zIndex explicitly, by reference to predefined value, or derive from props\n- __above__ {String|Number} Set the zIndex to be above the value\n- __below__ {String|Number} Set the zIndex to be below the value\n- __top__ {Boolean} Set the zIndex to be above all other ZIndex components\n- __bottom__ {Boolean} Set the zIndex to be below all other ZIndex components\n\nOptional additional props:\n\n- __important__ {Boolean} Set the `!important` flag on zIndex style value\n- __disabled__ {Boolean} Removes the zIndex style if true \n \nThe component will throw if not exactly one of these is given.\n\nExamples:\n\n```js\nimport ZIndex from 'react-z-index'\n\nZIndex.setVars({ Overlay: 100 })\n\n// e.g. toggle component at top of document using \"top\", \"important\", \"disabled\"\n\u003cZIndex top important disabled={this.props.display}\u003e\n  \u003cModal /\u003e\n\u003c/ZIndex\u003e\n\n// e.g. place component at derived zIndex using \"index\"\n\u003cZIndex index={(props) =\u003e props.modal.priority * 100}\u003e\n  \u003cModal /\u003e\n\u003c/ZIndex\u003e\n  \n// e.g. place component underneath something else using \"below\"\n\u003cZIndex below={ZIndex.vars.Overlay}\u003e // style['z-index'] =\u003e 99\n  \u003cModal /\u003e\n\u003c/ZIndex\u003e\n```\n\n## Decorator\n\n### `@zIndex(value\u003cString,Number,Function\u003e) : Component`\n\nWhen `value` is...\n\n- a `Number`, sets the zIndex of a component to a constant:\n\n    `@zIndex(100)`\n    \n- a `Function`, derives the zIndex of a component from its props:\n\n    `@zIndex((props) =\u003e props.modal.priority * 100)`\n    \n- a `String`, sets the zIndex of a component by reference to a predefined var:\n\n    `@zIndex(ZIndex.vars.Modal)`\n    \nReturns a React component.\n\nExample:\n\n```js\nimport { zIndex } from 'react-z-index'\n\n@zIndex(ZIndex.vars.Modal)\nreturn class Modal extends Component {\n  render () {\n    return (\n      \u003cdiv className='modal'\u003e\n        ...\n      \u003c/div\u003e\n    )\n  }\n}\n```\n\n## Style\n   \nIf you would like to use only the map of zIndex values you can do that too.\n\n```js\nimport ZIndex from 'react-z-index'\n\n// Inform lib of the value so we can pick it up \n// elsewhere in the app as ZIndex.vars.Modal\nconst zIndex = ZIndex.setVar('Modal', 100)\n\nclass Modal extends Component {\n  render () {\n    return (\n      \u003cdiv className='modal' style={{ zIndex }}\u003e\u003c/div\u003e\n    )\n  }\n}\n```\n\n## Contributing\n\nAll pull requests and issues welcome!\n\nIf you're not sure how to contribute, check out Kent C. Dodds'\n[great video tutorials on egghead.io](http://bit.ly/2aVzthz)!\n\n## Author \u0026 License\n\n`react-z-index` was created by [Sam Gluck](https://twitter.com/sdgluck) and is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdgluck%2Freact-z-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdgluck%2Freact-z-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdgluck%2Freact-z-index/lists"}