{"id":18850777,"url":"https://github.com/luqmanoop/react-lock-screen","last_synced_at":"2025-04-14T09:41:02.938Z","repository":{"id":57334141,"uuid":"219694838","full_name":"luqmanoop/react-lock-screen","owner":"luqmanoop","description":"Simple lock-screen for idle React applications","archived":false,"fork":false,"pushed_at":"2019-11-09T17:32:39.000Z","size":164,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T22:33:01.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-lock-screen","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/luqmanoop.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":"2019-11-05T08:30:54.000Z","updated_at":"2024-07-17T02:14:30.000Z","dependencies_parsed_at":"2022-08-31T03:30:46.918Z","dependency_job_id":null,"html_url":"https://github.com/luqmanoop/react-lock-screen","commit_stats":null,"previous_names":["luqmanoop/react-lock-screen","codeshifu/react-lock-screen"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-lock-screen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-lock-screen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-lock-screen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Freact-lock-screen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luqmanoop","download_url":"https://codeload.github.com/luqmanoop/react-lock-screen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855697,"owners_count":21172628,"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-11-08T03:31:29.314Z","updated_at":"2025-04-14T09:41:02.913Z","avatar_url":"https://github.com/luqmanoop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-lock-screen\n\n\u003e Simple lock-screen for idle React applications\n\nDisplay a custom lock-screen when your React applications becomes idle\n\n## Demo\nSee it in action [here](https://codesandbox.io/s/react-lock-screen-demo-q2zx3)\n\n## Prerequisites\n\n- [React 16.8+](https://reactjs.org/blog/2019/02/06/react-v16.8.0.html)\n\n## Installation\n\n```bash\n$ npm install react-lock-screen\n```\n\n## Usage\n\n```jsx\nimport LockScreen from 'react-lock-screen'\n...\n\nfunction App() {\n\n  const getLockScreenUi = (setLock) =\u003e {\n    return \u003cbutton onClick={() =\u003e setLock(false)}\u003eunlock\u003c/button\u003e\n  }\n\n  return (\n    \u003cLockScreen\n      timeout={2000}\n      ui={getLockScreenUi}\u003e\n      \u003cp\u003eLorem Ipsum is not simply\u003c/p\u003e\n    \u003c/LockScreen\u003e\n  )\n```\n\n## APIs (props)\n\n### timeout\n\ntype: `number`\n\nThe number of idle (milliseconds) time before screen is locked\n\n### ui\n\ntype: `function`\n\nA function that returns some jsx representing the UI to show when screen is locked. Recieves a function argument that can be used to toggle lock-screen state.\n\n```jsx\n\u003cLockScreen ui={setLock =\u003e \u003cbutton onClick={setLock(false)}\u003eunlock\u003c/button\u003e}\u003e\n  ...\n\u003c/LockScreen\u003e\n```\n\n### className\n\ntype: `string`\n\nClass name to be applied to the blurred div when screen is locked. This is useful if you want to change the blur amount (or other styles) of the div.\n\n\n```css\n/* default styles */\n.react-lock-screen {\n  filter: blur(4px);\n  userselect: none;\n  height: 100vh;\n  overflow: hidden;\n}\n```\noverride default styles using className prop\n```jsx\n\u003cLockScreen className=\"lock\"\u003e\n...\n```\n\n```css\n.react-lock-screen.lock {\n  /* your custom styles here */\n}\n```\n\n### onScreenLocked\n\ntype: `function`\n\nCallback function that gets called when screen is locked\n\n### onScreenUnlocked\n\ntype: `function`\n\nCallback function that gets called when screen is unlocked\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[react-lock-screen](https://github.com/codeshifu/react-lock-screen) is licensed under [MIT](https://github.com/codeshifu/react-lock-screen/blob/master/license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Freact-lock-screen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluqmanoop%2Freact-lock-screen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Freact-lock-screen/lists"}