{"id":13398039,"url":"https://github.com/svinkle/launchy","last_synced_at":"2025-10-10T12:34:02.933Z","repository":{"id":143885209,"uuid":"98812738","full_name":"svinkle/launchy","owner":"svinkle","description":"Launchy: An Accessible Modal Window","archived":false,"fork":false,"pushed_at":"2019-07-27T21:26:19.000Z","size":178,"stargazers_count":103,"open_issues_count":4,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T01:05:06.816Z","etag":null,"topics":["a11y","accessibility","dialog","html","javascript","modal"],"latest_commit_sha":null,"homepage":"https://svinkle.github.io/launchy","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/svinkle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-30T17:12:30.000Z","updated_at":"2024-03-13T03:26:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"d31db30f-167e-48b4-84ff-88f6f10b0bda","html_url":"https://github.com/svinkle/launchy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinkle%2Flaunchy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinkle%2Flaunchy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinkle%2Flaunchy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinkle%2Flaunchy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svinkle","download_url":"https://codeload.github.com/svinkle/launchy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248077479,"owners_count":21043972,"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":["a11y","accessibility","dialog","html","javascript","modal"],"created_at":"2024-07-30T18:02:03.322Z","updated_at":"2025-10-10T12:33:57.884Z","avatar_url":"https://github.com/svinkle.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/svinkle/launchy.svg?branch=master)](https://travis-ci.org/svinkle/launchy)\n[![npm version](https://badge.fury.io/js/launchy-modal-window.svg)](https://badge.fury.io/js/launchy-modal-window)\n\n# Launchy! 🚀\n\n\u003e An accessible modal window!\n\n## Features include:\n- Easy to use and implement!\n- On launch, keyboard focus shifts to the modal window container\n- The modal window is described via _optional_ modal heading\n- Traps the keyboard focus within the modal when active/visible\n- Closes the window on `esc` key press\n- Closes the window on overlay mouse `click`\n- Sets keyboard focus back to the launcher element on window close\n- Add your own custom close controls!\n- Add your own custom controls which send focus to somewhere else on the page!\n- Transparent border for Windows High Contrast themes\n\nFor more details on the accessibility of modal windows:\n- WCAG 2.4.3: https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-focus-order.html#navigation-mechanisms-focus-order-examples-head\n- WAI-ARIA Authoring Practices 1.1: https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal\n\n## Demo\n\n- Check out the [demo](https://svinkle.github.io/launchy)! 👈\n- Try your own HTML with the [CodePen](https://codepen.io/svinkle/pen/pjVepz/) demo!\n\n## Usage\n\n_Launchy!_ is very easy to install and use:\n\n### HTML\nWherever you want to have a _Launchy!_ control + window appear in your HTML content, simply **wrap** your content with a `\u003cdiv\u003e` and add the `data-launchy` attribute.\n\nExample:\n\n```html\n\u003cdiv data-launchy data-launchy-text=\"Launch window!\" data-launchy-title=\"My modal window\"\u003e\n    \u003cp\u003eThis content will appear in the modal window.\u003c/p\u003e\n\u003c/div\u003e\n```\n\n- **Required**: `data-launchy` -- Attribute is required but the value can be anything\n- **Required**: `data-launchy-text` -- This is the text that will be output to the launcher control\n- Optional: `data-launchy-title` -- The text which appears in the heading of the modal window, recommended for greater a11y context 👍\n- Optional: `data-launchy-button` -- If you'd rather have `button` elements instead of the default `a` elements as launcher and close controls\n\n\n#### Custom Close Controls\n\nYou can add your own custom close controls to any _Launchy!_ modal window!\n\n1. Add the HTML element you wish to use for the control within your content\n2. Apply the `data-launchy-close` attribute\n\nExample:\n\n```html\n\u003cdiv data-launchy data-launchy-text=\"Launch window!\" data-launchy-title=\"My modal window\"\u003e\n    \u003cp\u003eThis content will appear in the modal window.\u003c/p\u003e\n    \u003ca href=\"#\" data-launchy-close=\"🔥\"\u003eOk!\u003c/a\u003e\n\u003c/div\u003e\n```\n\nClicking on the _\"Ok!\"_ link will hide the modal window and send focus back to the launcher control!\n\n#### Custom Refocus Controls\n\nYou can add your own custom \"refocus\" controls to any _Launchy!_ modal window!\n\n1. Add the HTML element you wish to use for the control within your content\n2. Apply the `data-launchy-refocus` attribute\n3. Set the value of the `data-launchy-refocus` attribute to the `id` of the element you wish to send focus to\n\nExample:\n\n```html\n\u003cdiv data-launchy data-launchy-text=\"Launch window!\" data-launchy-title=\"My modal window\"\u003e\n    \u003cp\u003eThis content will appear in the modal window.\u003c/p\u003e\n    \u003ca href=\"#\" data-launchy-refocus=\"post-title\"\u003eSend me to the article headline!\u003c/a\u003e\n\u003c/div\u003e\n\n\u003c!-- Somewhere else in your page… --\u003e\n\u003ch1 id=\"post-title\" tabindex=\"-1\"\u003eMy perfect sundae…\u003c/h1\u003e\n```\n\nClicking on the _\"Send me to the article headline!\"_ link will hide the modal window and shift keyboard focus to the `\u003ch1 id=\"post-title\"/\u003e` element!\n\n### CSS\n\n_Launchy!_ has many CSS classes available on its generated elements for custom styles. Check out the [style.scss](https://github.com/svinkle/launchy/blob/master/brochure/css/sass/styles.scss) file for class names and an example on how you might want to style your modal windows!\n\n### JavaScript\nFor any site, grab the `/dist/launchy.js` file and include it at the bottom of your HTML page/template:\n\n```html\n\u003cscript src=\"js/launchy.js\"\u003e\u003c/script\u003e\n```\n\n_Launchy!_ will run automatically and generate all the modal windows for you!\n\n### `npm` Package\n_Launchy!_ is also available as an npm package!\n\n#### Install\n```sh\nnpm i launchy-modal-window\n```\n\n#### Usage\nInclude the `launchy.js` directly in your app or site template.\n\n```html\n\u003cscript src=\"node_modules/launchy-modal-window/launchy.js\"\u003e\u003c/script\u003e\n```\n\n## Contributions\nSee the [CONTRIBUTING](https://github.com/svinkle/launchy/blob/master/CONTRIBUTING.md) file.\n\n## License\nSee the [LICENSE](https://github.com/svinkle/launchy/blob/master/LICENSE.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvinkle%2Flaunchy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvinkle%2Flaunchy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvinkle%2Flaunchy/lists"}