{"id":50310272,"url":"https://github.com/webfuse-com/is-interactive","last_synced_at":"2026-05-28T20:30:29.913Z","repository":{"id":359374302,"uuid":"1223387906","full_name":"webfuse-com/is-interactive","owner":"webfuse-com","description":"Versatile DOM element interactivity checks.","archived":false,"fork":false,"pushed_at":"2026-05-21T15:08:40.000Z","size":117,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T00:11:14.091Z","etag":null,"topics":["is-interactive"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/webfuse-com.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T09:21:30.000Z","updated_at":"2026-05-21T15:22:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/webfuse-com/is-interactive","commit_stats":null,"previous_names":["webfuse-com/is-interactive"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/webfuse-com/is-interactive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfuse-com%2Fis-interactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfuse-com%2Fis-interactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfuse-com%2Fis-interactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfuse-com%2Fis-interactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webfuse-com","download_url":"https://codeload.github.com/webfuse-com/is-interactive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfuse-com%2Fis-interactive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33626136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["is-interactive"],"created_at":"2026-05-28T20:30:28.466Z","updated_at":"2026-05-28T20:30:29.857Z","avatar_url":"https://github.com/webfuse-com.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Is Interactive?\n\nVersatile DOM element interactivity checks.\n\n``` console\nnpm install webfuse-com/is-interactive\n```\n\n### Example\n\n``` js\nimport { checkInteractivity, filterInteractive } from \"@webfuse-com/is-interactive\";\n\n// Check if an element is interactive:\nconst click = targetElement =\u003e {\n  const { isInteractive } = checkInteractivity(targetElement, {\n    invisible: false  // disables invisible check\n  });\n\n  if(!isInteractive) return;\n\n  automation.click(button);\n};\n\n// Create a DOM snapshot (weakly corresponding to the GUI):\nconst surfaceDOMSnapshot = selector =\u003e {\n  return filterInteractive(document, {\n    offViewport: true\n  }).outerHTML;\n};\n```\n\n### API\n\n``` ts\n// Toggle checks to perform (default: all enabled, except 'offViewport')\ninterface InteractivityChecks {\n  disconnected: boolean;\n  hidden: boolean;\n  inert: boolean;\n  disabled: boolean;\n  ariaHidden: boolean;\n  invisible: boolean;\n  unclickable: boolean;\n  collapsed: boolean;\n  clipped: boolean;\n  occluded: boolean;\n  offViewport: boolean;\n}\n\n/**\n * Check whether an element is interactive.\n */\nfunction checkInteractivity(element: Element, checks?: InteractivityChecks): {\n  isInteractive: boolean;\n  reason?:\n    | \"disconnected\"\n    | \"hidden\"\n    | \"inert\"\n    | \"disabled\"\n    | \"ariaHidden\"\n    | \"invisible\"\n    | \"unclickable\"\n    | \"collapsed\"\n    | \"occluded\"\n    | \"offViewport\";\n}\n\n/**\n * Filter a DOM (sub)tree for interactive elements.\n * Create a 'surface'-only DOM.\n */\nfunction filterInteractive(dom: Document | Element, checks?: InteractivityChecks): Element\n```\n\n### DEMO\n\nOpen [demo/demo.html](./demo/demo.html) in a browser.\n\n\u003ca href=\"./demo/demo.html\"\u003e\n  \u003cimg width=\"830\" src=\"./.github/demo-screenshot.png\"\u003e\n\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfuse-com%2Fis-interactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebfuse-com%2Fis-interactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfuse-com%2Fis-interactive/lists"}