Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/firstandthird/simple-domodal
- Owner: firstandthird
- License: mit
- Created: 2017-12-01T07:42:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T21:55:30.000Z (about 2 years ago)
- Last Synced: 2025-01-15T08:07:15.820Z (7 days ago)
- Language: JavaScript
- Size: 632 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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. |