Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghosh/Micromodal
⭕ Tiny javascript library for creating accessible modal dialogs
https://github.com/ghosh/Micromodal
accessibility javascript modal modal-dialogs vanilla-javascript
Last synced: 3 months ago
JSON representation
⭕ Tiny javascript library for creating accessible modal dialogs
- Host: GitHub
- URL: https://github.com/ghosh/Micromodal
- Owner: ghosh
- License: mit
- Created: 2017-08-10T17:24:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T04:46:03.000Z (about 1 year ago)
- Last Synced: 2024-04-15T16:11:05.124Z (10 months ago)
- Topics: accessibility, javascript, modal, modal-dialogs, vanilla-javascript
- Language: JavaScript
- Homepage: https://micromodal.now.sh/
- Size: 3.01 MB
- Stars: 3,483
- Watchers: 36
- Forks: 231
- Open Issues: 66
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome - Micromodal - ⭕ Tiny javascript library for creating accessible modal dialogs (CSS)
- jimsghstars - ghosh/Micromodal - ⭕ Tiny javascript library for creating accessible modal dialogs (JavaScript)
README
Micromodal.js
Tiny, dependency-free javascript library for creating accessible modal dialogs---
The aim of this library is to make modal dialogs accessible and easy to include in your project with minimum configuration. It's only ~1.8kb minified and gzipped - A tiny library for big change.
**[Demo and documentation](https://micromodal.now.sh/)**
## Features
✔ Toggles relevant aria attributes on open and close✔ Closes modal on overlay click
✔ Closes modal on pressing the `esc` key
✔ Traps tab focus within the modal
✔ Focuses on the first focusable element within the modal
✔ Retains the focused element state after closing the modal
## Installation
**via npm**
```shell
npm install micromodal --save
```**via yarn**
```shell
yarn add micromodal
```**via CDN direct link**
```html```
**direct download**
```shell
curl -O -L https://unpkg.com/micromodal/dist/micromodal.min.js
```
## IE 11 and below
Please use this pollyfill suggested [here](https://github.com/ghosh/Micromodal/issues/49#issuecomment-424213347).
## Changelog
Find the latest changelog [here](https://github.com/ghosh/micromodal/blob/master/CHANGELOG.md).
## Contributing
We are always open and invite developers to contribute to Micromodal. We have kept the guidelines and process dead simple, so you invest more time in making modals accessible to all.
Micromodal follows the [standardjs](https://standardjs.com/) coding standard and is part of our `package.json` file. It will help us to maintain consistency in the code base.
#### Development setup
1. Clone Github repo `$ git clone https://github.com/ghosh/micromodal.git`
2. Install `yarn` package manager (Read [installation guide](https://yarnpkg.com/en/docs/install#mac-tab))
3. Run `yarn install` in the root folder to install all dependencies
4. Run `yarn dev` to start a dev server. This serves the example directory and live reloads when any files are changed
5. [Optional] Run `yarn build` to build the files for distribution. This is run automatically as a pre-commit hook as well.
6. Send us pull request and chill
## Licensing
This project is licensed under [MIT license](https://opensource.org/licenses/MIT).
## Related
- [Microtip](https://github.com/ghosh/microtip) - Modern, lightweight, accessible css tooltip library. Just 1kb.
## Contact
You can mention us on Twitter for any questions, suggestions or just send us funny GIF. We ♥️ GIFs.#### Tweet some love
[Tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fgoo.gl%2FsEgnBZ&text=Make%20your%20modal%20dialogs%20accessible%20to%20all%20using%20Micromodal.js%2C%20a%20tiny%20library%20for%20big%20change.&hashtags=a11y "Tweet about Micromodal") about Micromodal and help us to spread the message about the importance of Web accessibility and Inclusive design.
## Created and maintained by
Indrashish Ghosh – [@_ighosh](https://twitter.com/_ighosh) 🇮🇳
Kalpesh Singh - [@knowkalpesh](https://twitter.com/knowkalpesh) 🇮🇳
Darpan Kakadia - [@kakadiadarpan](https://twitter.com/kakadiadarpan) 🇩🇪
Contributors - [list](https://github.com/ghosh/micromodal/graphs/contributors) 🌐