{"id":26737561,"url":"https://github.com/junkwarrior87/use-modal","last_synced_at":"2026-04-18T00:01:49.806Z","repository":{"id":65969802,"uuid":"603681484","full_name":"junkwarrior87/use-modal","owner":"junkwarrior87","description":"Wrapper hooks for handling modal dialogs in React","archived":false,"fork":false,"pushed_at":"2023-07-14T09:10:00.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T23:11:35.626Z","etag":null,"topics":["dialog","hooks","hooks-async","modal","modal-dialog","react","react-hooks"],"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/junkwarrior87.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-19T08:58:48.000Z","updated_at":"2023-07-14T09:10:06.000Z","dependencies_parsed_at":"2024-10-24T10:47:55.195Z","dependency_job_id":"bf025b6d-cf91-4585-b18f-4d5a5262ede4","html_url":"https://github.com/junkwarrior87/use-modal","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"2945ea067a6ae3af5042db26754061c19f7bed31"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/junkwarrior87/use-modal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkwarrior87%2Fuse-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkwarrior87%2Fuse-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkwarrior87%2Fuse-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkwarrior87%2Fuse-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junkwarrior87","download_url":"https://codeload.github.com/junkwarrior87/use-modal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkwarrior87%2Fuse-modal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dialog","hooks","hooks-async","modal","modal-dialog","react","react-hooks"],"created_at":"2025-03-28T02:51:24.922Z","updated_at":"2026-04-18T00:01:49.782Z","avatar_url":"https://github.com/junkwarrior87.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-modal\n\nWrapper hooks for handling modal dialogs in React\n\n## Install\n\n```sh\nnpm i @goldfinger87/use-modal\n```\n\n## Usage\n\n```tsx\nimport {Ref, useImperativeHandle} from 'react';\nimport {ModalHandle, useModal, useModalHandle} from '@goldfinger87/use-modal';\n\nfunction Modal({handle}: { handle: Ref\u003cModalHandle\u003e }) {\n    const [ref, imp] = useModal();\n    const {hide} = imp;\n    useImperativeHandle(handle, () =\u003e imp, []);\n    return \u003cdialog ref={ref}\u003e\n        \u003cbutton onClick={() =\u003e hide()}\u003ehide\u003c/button\u003e\n        \u003cbutton onClick={() =\u003e hide('returnValue')}\u003ehide w/ value\u003c/button\u003e\n    \u003c/dialog\u003e;\n}\n\nfunction App() {\n    const modal = useModalHandle();\n    return \u003c\u003e\n        \u003cModal handle={modal}/\u003e\n        \u003cbutton onClick={() =\u003e modal.current.show()}\u003eshow\u003c/button\u003e\n        \u003cbutton onClick={() =\u003e modal.current.showAsync('init').then(console.log)}\u003eshowAsync\u003c/button\u003e\n    \u003c/\u003e;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunkwarrior87%2Fuse-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunkwarrior87%2Fuse-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunkwarrior87%2Fuse-modal/lists"}