Socket
Book a DemoInstallSign in
Socket

modal-element

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modal-element

A basic modal DOM element

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

modal-element

A basic modal element built on yo-yo.

Example

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

Keywords

yo-yo

FAQs

Package last updated on 10 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts