{"id":42830298,"url":"https://github.com/wide/modulus-modal","last_synced_at":"2026-01-30T11:26:47.884Z","repository":{"id":43838664,"uuid":"267886617","full_name":"wide/modulus-modal","owner":"wide","description":"Modal component for Modulus","archived":false,"fork":false,"pushed_at":"2022-02-16T13:21:08.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-09-28T13:37:05.368Z","etag":null,"topics":["modulus"],"latest_commit_sha":null,"homepage":"","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/wide.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":"2020-05-29T15:05:17.000Z","updated_at":"2022-01-12T16:22:35.000Z","dependencies_parsed_at":"2022-09-11T14:02:24.714Z","dependency_job_id":null,"html_url":"https://github.com/wide/modulus-modal","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/wide/modulus-modal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fmodulus-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fmodulus-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fmodulus-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fmodulus-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wide","download_url":"https://codeload.github.com/wide/modulus-modal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fmodulus-modal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"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":["modulus"],"created_at":"2026-01-30T11:26:47.259Z","updated_at":"2026-01-30T11:26:47.875Z","avatar_url":"https://github.com/wide.png","language":"JavaScript","readme":"# Modulus Modal\n\nEnhanced modal component, to be used with `@wide/modulus`.\n\n\n## Install\n\n```\nnpm install @wide/modulus-modal --save\n```\n\n\n## Usage\n\nRegister this component using `Modulus`:\n```js\nimport modulus from '@wide/modulus'\nimport Modal from '@wide/modulus-modal'\n\nmodulus.component('modal', Modal)\n```\n\nImport base `scss` styles:\n```scss\n@use '@wide/modulus-modal';\n```\n\nAnd use the provided `twig` template:\n```twig\n{% embed '@wide::modulus-modal' with { id: 'modalOne' } %}\n  {% block content %}\n    HEY!\n  {% endblock %}\n{% embed %}\n```\n\nOr build your own `html`:\n```html\n\u003cdiv class=\"modal\" role=\"dialog\" id=\"modalOne\"\u003e\n  \u003cdiv class=\"modal_body\"\u003e\n    \u003cbutton class=\"modal_close\" data-modal.close\u003e\u003c/button\u003e\n    \u003cdiv class=\"modal_content\" data-modal.content\u003e\n      HEY!\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"modal_backdrop\" data-modal.close\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n\n## Open modal\n\nTo open the modal from a button:\n```html\n\u003cbutton data-modal=\"modalOne\"\u003eOpen Modal One\u003c/button\u003e\n```\n\nTo open the modal programmatically:\n```js\nimport { seek } from '@wide/modulus'\n\nseek('modalOne').open()\n```\n\n\n## Default focused element\n\nTo choose which element will be focused when opening, add `data-focus` attribute:\n```html\n\u003cbutton class=\"btn-primary\" data-focus\u003eConfirm\u003c/button\u003e\n```\n\nBy default, if there is no `data-focus` attribute defined, the first element of type above will be focused.\n\n - `button` (excluding close button)\n - `a` (with `[href]` attribute)\n - `input`\n - `select`\n - `textarea`\n - Element with `[tabindex]` attribute (with value different of `[tabindex=\"-1\"]`)\n - Close button\n\n\n## Libraries\n\nThis package uses :\n- [`hotkeys-js`](https://github.com/jaywcjlove/hotkeys)\n\n\n## Authors\n\n- **Aymeric Assier** - [github.com/myeti](https://github.com/myeti)\n- **Julien Martins Da Costa** - [github.com/jdacosta](https://github.com/jdacosta)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [licence](licence) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fmodulus-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwide%2Fmodulus-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fmodulus-modal/lists"}