Skip to content
Marc Espín Sanz edited this page Jun 23, 2020 · 7 revisions

A dialog can be created using the Window constructor.

A simple example:

function entry(API){

  const myDialog = new API.Dialog({
    tite: 'My dialog',
    content: 'Here it goes the body'
  })

  myDialog.launch() 
}

The Dialog constructors takes only one object as argument.

Properties:

  • title: The dialog title,
  • content: it's content
  • component( optional): a puffin component, this will replace content
  • height( optional): define a custom height, default to 200px
  • width( optional): define a custom width, default to 300px

Returns:

  • launch(): method to open the window
  • close(): method to close the window

A simple example:

function entry(API){

  const myDialog = new API.Dialog({
    tite: 'My dialog',
    component: () => API.puffin.element`<p>Hello  World</p>`,
    height: '100px',
    width: '100px'
  })

  myDialog.launch()
}

Documentation

Tutorials

Contributing

About

Clone this wiki locally