luna-window
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Luna Window

HTML5 window manager.

Demo

https://luna.liriliri.io/?path=/story/window

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-window/luna-window.css" />
<script src="//cdn.jsdelivr.net/npm/luna-window/luna-window.js"></script>

You can also get it on npm.

npm install luna-window --save
import 'luna-window/luna-window.css'
import LunaWindow from 'luna-window'

Usage

const win = new LunaWindow({
  title: 'Window Title',
  x: 50,
  y: 50,
  width: 800,
  height: 600,
  content: 'This is the content.'
})
win.show()

Configuration

  • x(number): Offset to the left of the viewport.
  • y(number): Offset to the top of the viewport.
  • width(number): Width of the window.
  • height(number): Height of the window.
  • title(number): Title of the window.
  • content(string | HTMLElement): Content to display, url is supported.
  • minWidth(number): Minimum width of the window.
  • minHeight(number): Minimum height of the window.

Api

show(): void

Show the window.

minimize(): void

Minimize the window.

maximize(): void

Maximize the window.

Readme

Keywords

Package Sidebar

Install

npm i luna-window

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

212 kB

Total Files

12

Last publish

Collaborators

  • surunzi