@lemuria/popup
v1.1.1
Published
The Function To Open A Popup.
Downloads
10
Readme
@lemuria/popup
@lemuria/popup
is The Function To Open A Popup.
yarn add @lemuria/popup
Table Of Contents
API
The package is available by importing its default function:
import Popup from '@lemuria/popup'
The package publishes both main
and module
fields, where main
exports a CommonJS module (require), and module
exports an ES6 module (import).
Popup( url: string,
title: string,
width=: ?number,
height=: ?number,
features=: !Object<string, string>,
): Window
Opens a popup in the middle of the screen by setting width/left and height/top properties according to the arguments. See https://developer.mozilla.org/en-US/docs/Web/API/Window/open for all features. Returns the reference to the window.
- url*
string
: The URL to open. - title*
string
: The window title. - width
?number
(optional): The width of the popup. Enables horizontal centering. - height
?number
(optional): The height of the popup. Enables vertical centering. - features !Object<string, string> (optional): Window features. When compiling with Closure Compiler, some properties might need to appear in quotes, e.g.,
{ 'status': 'no' }
as there are no externs for them.
import Popup from '@lemuria/popup'
const editor = Popup('/admin/editor', 'Editor', 900, 650, {
menubar: 'yes',
})
Copyright
Window features are copyright of MDN authors.