{"id":43353062,"url":"https://github.com/felipe1234-dev/use-on-screen","last_synced_at":"2026-02-02T02:34:08.099Z","repository":{"id":57388251,"uuid":"412627555","full_name":"felipe1234-dev/use-on-screen","owner":"felipe1234-dev","description":"A React Hooks npm package to check if element is on screen viewport or not.","archived":false,"fork":false,"pushed_at":"2021-10-15T20:10:09.000Z","size":198,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T12:40:13.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felipe1234-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-01T21:59:48.000Z","updated_at":"2021-10-15T20:10:12.000Z","dependencies_parsed_at":"2022-09-09T18:11:56.862Z","dependency_job_id":null,"html_url":"https://github.com/felipe1234-dev/use-on-screen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felipe1234-dev/use-on-screen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipe1234-dev%2Fuse-on-screen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipe1234-dev%2Fuse-on-screen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipe1234-dev%2Fuse-on-screen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipe1234-dev%2Fuse-on-screen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipe1234-dev","download_url":"https://codeload.github.com/felipe1234-dev/use-on-screen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipe1234-dev%2Fuse-on-screen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29001655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T01:32:03.847Z","status":"online","status_checked_at":"2026-02-02T02:00:07.448Z","response_time":58,"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":[],"created_at":"2026-02-02T02:34:07.453Z","updated_at":"2026-02-02T02:34:08.094Z","avatar_url":"https://github.com/felipe1234-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use On Screen\n\n**use-on-screen** is a React Hooks library used to detect if a certain element is visible on the screen, both in a scrollable container and in the window.\n\n## Installation ⚙️\n\nUse the package manager [npm](https://www.npmjs.com/) to install **use-on-screen**.\n\n```bash\nnpm install use-on-screen\n```\n\n## Usage 🛠️\n\n```javascript\n// ...\nimport useOnScreen from \"use-on-screen\";\n\nfunction FakeFeed() {\n    const [visible, position] = useOnScreen({\n        target: \"#loader\", // default: \"\"\n        parent: \"#feed\", \n        // if the parent is not defined, \n        // it will consider the entire user's viewport\n        delay: 500 // default: 1000\n    });\n    \n    // ...\n    \n    // Use useEffect() to call a function when element is visible\n    useEffect(() =\u003e {\n        if (visible) {\n            loadMorePosts();\n            console.log(position);\n        }\n    }, [visible]);\n\n    // ...\n\n    return (\n        \u003csection id=\"feed\"\u003e\n            {/*\n                Many other posts over here...\n            */}\n            \u003cspan id=\"loader\"\u003e\u003c/span\u003e {/* if visible, it will \n            load more posts*/}\n        \u003c/section\u003e\n    );\n}\n```\n\n## Contributing 💭\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[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipe1234-dev%2Fuse-on-screen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipe1234-dev%2Fuse-on-screen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipe1234-dev%2Fuse-on-screen/lists"}