Comparing version 0.0.1 to 0.1.0
{ | ||
"name": "pure-modal", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "A lightweight, accessible, vanilla JavaScript modal component", | ||
@@ -5,0 +5,0 @@ "main": "src/modal.js", |
@@ -1,2 +0,6 @@ | ||
# Pure-modal (WIP) | ||
<p align="center"> | ||
<img width="100" height="100" src="https://i.imgur.com/mfvfVlh.png" /> | ||
</p> | ||
# Pure-modal | ||
A lightweight, accessible, vanilla JavaScript modal component. | ||
@@ -48,1 +52,21 @@ | ||
### Done! 🎉 | ||
## API | ||
### Options | ||
| Name |type | Default | Description | ||
| -----------------|----------------|----------------|------------- | ||
| transition | Boolean | true | Initialize PureModal instance. Add event listeners. | ||
| beforeOpen | Function | null | A callback that will be called before opening the modal. | ||
| onOpen | Function | null | A callback that will be called after the modal is fully opened. | ||
| beforeClose | Function | null | A callback that will be called before closing the modal. | ||
| onClose | Function | null | A callback that will be called after the modal is fully closed. | ||
### Methods | ||
| Name | Description | ||
| -----------------|--------------- | ||
| `init()` | Initialize PureModal instance. Add event listeners. | ||
| `destroy()` | Destroy all event listeners. Useful when building SPA. | ||
| `open()` | Call to open modal manually. | ||
| `close()` | Call to close modal manually. |
27892
72