An open API service indexing awesome lists of open source software.

https://github.com/alecaddd/amodal

Super lightweight and dependency free Modal built in ES6
https://github.com/alecaddd/amodal

css3 ecmascript2015 es2015 es6 modal

Last synced: 9 months ago
JSON representation

Super lightweight and dependency free Modal built in ES6

Awesome Lists containing this project

README

          

# aModal
> Super lightweight and dependency free Modal built in ES6

[Demo on CodePen](https://codepen.io/Alecaddd/pen/XgdKjB)

## Installation

* Using NPM:
```sh
npm install amodal --save
```

* Using Bower:
```sh
bower install amodal --save
```

## Include it in your project.

* The script is already compiled via Gulp, browserify and babelify. Use it with Webpack, Browserify, RequireJS or by simply including a `` tag.

* ES 2015
```javascript
import 'amodal';
```

* CommonJS:
```javascript
require('amodal');
```

* AMD
```javascript
require(['/node_modules/amodal/dist/index.js']);
```

* Browser
```html
<script src="/node_modules/amodal/dist/index.js">
```

Be sure to include or import the default style

* SCSS
```scss
@import '/node_modules/amodal/dist/modal.css';
```

* Browser
```html

```

## Create the Modal HTML

```html


```

* **Backdrop Support**: By default, the Modal will automatically close if a click is registered on the backdrop dark overlay area underneath an open modal. You can control this behaviour by setting a boolean data attribute to your modal container.

```html