# modal-element

> A basic modal DOM element

Latest version **2.0.0** (published 2016-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install modal-element
pnpm add modal-element
yarn add modal-element
bun add modal-element
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-09-10 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kyle Robinson Young |
| Maintainers | shama |
| Keywords | yo-yo, dom, element, modal |

## Links

- npm: https://www.npmjs.com/package/modal-element
- Repository: https://github.com/shama/modal-element
- Homepage: https://github.com/shama/modal-element#readme
- Issues: https://github.com/shama/modal-element/issues
- npm.io page: https://npm.io/package/modal-element

## Dependencies (4)

- [yo-yo](https://npm.io/package/yo-yo.md) ^1.2.1
- [global](https://npm.io/package/global.md) ^4.3.0
- [on-load](https://npm.io/package/on-load.md) ^2.1.0
- [object-assign](https://npm.io/package/object-assign.md) ^2.1.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2016-09-10
- 1.0.0 — 2015-05-16

## README

# modal-element

A basic modal element built on [yo-yo](https://github.com/maxogden/yo-yo).

## Example

```js
var createModal = require('modal-element')
var yo = require('yo-yo')

var contents = yo`<div>
  <h3>Header</h3>
  <p>This is a modal</p>
</div>`

// Render the modal with contents
var modal = createModal(modalContents)

// Call to hide modal
modal.hide()

// Call to show the modal again
modal.show()
```

## API

### `var modal = createModal(contents)`
Creates a new modal element.

#### `modal.toggle([newContents])`
Will hide or show modal.

#### `modal.show([newContents])`
Shows the modal and/or overrides the contents.

#### `modal.hide()`
Hides the modal.

# license
(c) 2016 Kyle Robinson Young. MIT License

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