# simple-domodal

> Simple modal using Domodule Edit

Latest version **2.1.0** (published 2019-07-02) · 0 weekly downloads

## Install

```sh
npm install simple-domodal
pnpm add simple-domodal
yarn add simple-domodal
bun add simple-domodal
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-07-02 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 33.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | alaguna, aleperez92, dawnerd, ecwillis, jga, orthagonal1 |
| Keywords | modal, Domodule |

## Links

- npm: https://www.npmjs.com/package/simple-domodal
- Repository: https://github.com/firstandthird/simple-domodal
- Homepage: https://github.com/firstandthird/simple-domodal#readme
- Issues: https://github.com/firstandthird/simple-domodal/issues
- npm.io page: https://npm.io/package/simple-domodal

## Dependencies (2)

- [domodule](https://npm.io/package/domodule.md) ^6.1.0
- [domassist](https://npm.io/package/domassist.md) ^2.2.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2019-07-02
- 2.0.1 — 2019-06-07
- 2.0.0 — 2019-04-12
- 1.2.0 — 2019-02-12
- 1.1.1 — 2018-06-26
- 1.1.0 — 2018-05-04
- 1.0.3 — 2018-03-08
- 1.0.2 — 2018-03-06
- 1.0.1 — 2018-03-02
- 1.0.0 — 2018-02-20

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

<body>
  <button aria-controls="some-id">This aria-controls will open the modal</button>

  <div id="some-id"
       class="modal"
       data-module="SimpleModal"
       data-module-auto-open="false"
       data-module-closable="true"
       role="dialog"
       tabindex="-1">

    <div class="modal-content padding-md text-center" data-name="modal">
      <button class="modal-close" data-action="close" aria-label="Close modal">
        <span aria-hidden="true">×</span>
      </button>
    </div>
  </div>

  <script src="simple-domodal.js"></script>
</body>
```

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

---
_Source: https://npm.io/package/simple-domodal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
