Code Monkey home page Code Monkey logo

micromodal's Introduction

Micromodal.js

Made with love License Package version

Lightweight, configurable accessible modal library written in pure JavaScript.


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.9kb minified and gzipped (Happy dance 👯) - 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://unpkg.com/micromodal/dist/micromodal.min.js"></script>

direct download

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

 

Release History

  • 0.1.1
    • BUGFIX: Fixed issue where validation was not firing
  • 0.1.0
    • CHANGE: Released first minor version 😊

 

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 great again! 🇺🇸

Micromodal follows the standardjs coding standard and is part of our package.json file. It will help us to maintain consistency in the codebase.

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 ♥️ GIF.

Tweet some love Tweet

Tweet about Micromodal and help us to spread the message about the importance of Web accessibility and Inclusive design.

 

Contributors

Indrashish Ghosh – @_ighosh 🇮🇳

Kalpesh Singh - @knowkalpesh 🇮🇳

micromodal's People

Contributors

ghosh avatar kalpeshsingh avatar

Watchers

Helmar Fantilanan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.