New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svelte-modal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-modal

A vanilla JS modal component made with Svelte.

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

svelte-modal

A vanilla JS basic popup modal made with Svelte. Use this as the base component for making nice, useful modals, like svelte-dialog.

View the demo.

install

$ npm install svelte-modal

TODO

example

import Modal from 'svelte-modal'

const content = document.createElement('p')
content.textContent = 'Modal content.'

const modal = new Modal({
  center: false, // false => aligned to top, true => aligned to center
  zIndexBase: 1, // adjust the relative z-index of the modal
  transitionDuration: 225, // duration of transition in and out
  pressScrimToDismiss: true, // press outside the modal to dismiss it
  escapeToDismiss: true, // press escape key to dismiss the modal
  slots: { default: content }
})

modal.on('result', result => {
  result // result of either modal.close or modal.dismiss
})

modal.on('closed', result => {
  result // result that was passed to `modal.close`
})

modal.on('dismissed', result => {
  result // result that was passed to `modal.dismissed`
})

modal.on('hidden', () => {}) // fires when the modal has finished transitioning out

modal.open()

modal.close('foo')
// or
modal.dismiss('bar')

Keywords

FAQs

Package last updated on 15 Oct 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc