Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/firstandthird/simple-domodal

Simple modal using Domodule
https://github.com/firstandthird/simple-domodal

Last synced: 3 days ago
JSON representation

Simple modal using Domodule

Awesome Lists containing this project

README

        

# Simple Domodal

![npm](https://img.shields.io/npm/v/simple-domodal.svg)

Simple modal using Domodule

## Installation

```sh
npm install simple-domodal
```

## Usage

### JavaScript

```js
import 'simple-domodal';
// or
import SimpleModal from 'simple-domodal';
```

### HTML

```html
...

This aria-controls will open the modal

```

## Events

Custom events are fired on open/close and you can fire an event to open the modal.

| Event | Where | When |
|----------------|---------------------------------------------|-----------------|
| `modal:reveal` | If fired on the modal, the modal will open. | |
| `modal:opened` | On the modal. | On modal open. |
| `modal:closed` | On the modal. | On modal close. |

## Options

| Option | Default | Action |
|------------|---------------|--------------------------------------------------------|
| `autoOpen` | `false` | If `true` the modal will open on pageload. |
| `closable` | `true` | If `true` modal won't disappear on close. |
| `focus` | Modal Element | Element that will gain focus once the modal is opened. |