1.0.5 • Published 4 years ago

ihmodals v1.0.5

Weekly downloads
232
License
MIT
Repository
github
Last release
4 years ago

IHModals Build Status codecov dependencies Status size

IHModals is a lightweight, simple, accessible and tested framework for creating modals. The library has no dependencies and provides its codes unbundled sass and es6 or as bundled css and javascript.

Demo

Demo can be checked Here

Usage

Include javascript and styling. Javascript can be included by importing

import IHModals from "ihmodals";

or by including the built bundle

<script src="/dist/ihmodals.min.js" type="application/javascript"></script>

The styling can be included with sass

@import "~ihmodals/dist/ihmodals.scss";

The styles can be customized with variables that can be overwritten. Variables can be checked here.

Built css is also included.

<link href="dist/ihmodals.css" rel="stylesheet">

After including the library modal can be initialized with IHModals class.

const modal = new IHModals(element);

where element is the element you want to turn into a modal, for example

<div class="modal" role="dialog" aria-modal="true" aria-labelledby="modal-title" aria-describedby="modal-description">

    <h2 id="modal-title">Test</h2>
    <p id="modal-description">This is a test modal.</p>
</div>

Modal provides necessary methods to open and close modals. Check the detailed api here.

Development

This project uses yarn in development. To run unit tests, run

yarn test

to build, run

yarn build

License

This project is licensed under MIT license.

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago