{"id":16827037,"url":"https://github.com/wojtekmaj/detect-element-overflow","last_synced_at":"2025-04-05T09:07:24.661Z","repository":{"id":49471533,"uuid":"102519413","full_name":"wojtekmaj/detect-element-overflow","owner":"wojtekmaj","description":"A function that tells you whether a given element is overflowing its container or not. Useful for creating dropdowns and tooltips.","archived":false,"fork":false,"pushed_at":"2025-03-20T23:07:14.000Z","size":3381,"stargazers_count":25,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T08:07:45.512Z","etag":null,"topics":["collision","collision-detection","position"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/wojtekmaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"wojtekmaj"}},"created_at":"2017-09-05T19:04:15.000Z","updated_at":"2025-03-20T23:07:17.000Z","dependencies_parsed_at":"2023-10-24T21:32:13.838Z","dependency_job_id":"432c2942-da16-47d4-8d4b-81a813765fd4","html_url":"https://github.com/wojtekmaj/detect-element-overflow","commit_stats":{"total_commits":198,"total_committers":4,"mean_commits":49.5,"dds":0.0757575757575758,"last_synced_commit":"feba079856d6767fc61d42cce2bc42877a9b4615"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fdetect-element-overflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fdetect-element-overflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fdetect-element-overflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekmaj%2Fdetect-element-overflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wojtekmaj","download_url":"https://codeload.github.com/wojtekmaj/detect-element-overflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312078,"owners_count":20918344,"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":["collision","collision-detection","position"],"created_at":"2024-10-13T11:19:27.221Z","updated_at":"2025-04-05T09:07:24.631Z","avatar_url":"https://github.com/wojtekmaj.png","language":"TypeScript","funding_links":["https://github.com/sponsors/wojtekmaj"],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/detect-element-overflow.svg)](https://www.npmjs.com/package/detect-element-overflow) ![downloads](https://img.shields.io/npm/dt/detect-element-overflow.svg) [![CI](https://github.com/wojtekmaj/detect-element-overflow/actions/workflows/ci.yml/badge.svg)](https://github.com/wojtekmaj/detect-element-overflow/actions)\n\n# Detect-Element-Overflow\n\nA function that tells you whether a given element is overflowing its container or not. Useful for creating dropdowns and tooltips.\n\n## tl;dr\n\n- Install by executing `npm install detect-element-overflow` or `yarn add detect-element-overflow`.\n- Import by adding `import detectElementOverflow from 'detect-element-overflow'`.\n- Do stuff with it!\n  ```ts\n  const collisions = detectElementOverflow(child, parent);\n  ```\n\n## User guide\n\nDetect-Element-Overflow returns an object with getter functions described below.\n\n| Attribute name | Description                                                                                                                                                         | Example values |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |\n| collidedTop    | Whether or not the child element collided with the top parent's border.                                                                                             | `true`         |\n| collidedBottom | Whether or not the child element collided with the bottom parent's border.                                                                                          | `true`         |\n| collidedLeft   | Whether or not the child element collided with the left parent's border.                                                                                            | `true`         |\n| collidedRight  | Whether or not the child element collided with the right parent's border.                                                                                           | `true`         |\n| overflowTop    | How many pixels of the child have crossed the top parent's border. Negative values specify how many pixels are between the child and the top parent's border.       | `20`, `-15`    |\n| overflowBottom | How many pixels of the child have crossed the bottom parent's border. Negative values specify how many pixels are between the child and the bottom parent's border. | `20`, `-15`    |\n| overflowLeft   | How many pixels of the child have crossed the left parent's border. Negative values specify how many pixels are between the child and the left parent's border.     | `20`, `-15`    |\n| overflowRight  | How many pixels of the child have crossed the right parent's border. Negative values specify how many pixels are between the child and the right parent's border.   | `20`, `-15`    |\n\n## License\n\nThe MIT License.\n\n## Author\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd \u003e\n      \u003cimg src=\"https://avatars.githubusercontent.com/u/5426427?v=4\u0026s=128\" width=\"64\" height=\"64\" alt=\"Wojciech Maj\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://github.com/wojtekmaj\"\u003eWojciech Maj\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekmaj%2Fdetect-element-overflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwojtekmaj%2Fdetect-element-overflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekmaj%2Fdetect-element-overflow/lists"}