• Stars
    star
    3,536
  • Rank 12,568 (Top 0.3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

โญ• Tiny javascript library for creating accessible modal dialogs

Micromodal.js

Made with love License Package version Build Status

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

ย 

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

npm install micromodal --save

via yarn

yarn add micromodal

via CDN direct link

<script src="https://cdn.jsdelivr.net/npm/micromodal/dist/micromodal.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/micromodal/dist/micromodal.min.js"></script>

direct download

curl -O -L https://unpkg.com/micromodal/dist/micromodal.min.js

ย 

IE 11 and below

Please use this pollyfill suggested here.

ย 

Changelog

Find the latest changelog here.

ย 

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 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)
  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.

ย 

Related

  • 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 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 ๐Ÿ‡ฎ๐Ÿ‡ณ

Kalpesh Singh - @knowkalpesh ๐Ÿ‡ฎ๐Ÿ‡ณ

Darpan Kakadia - @kakadiadarpan ๐Ÿ‡ฉ๐Ÿ‡ช

Contributors - list ๐ŸŒ