1.0.6 • Published 4 years ago
crelm-popup v1.0.6
crelm-popup
A small (<2kb), simple popup component with responsive design using the crelm library. Crelm is the only dependency.
Install:
npm i crelm-popup
Utilization:
let popup = require('crelm-popup')
popup(childrenElements:array, [closeOnBlurClick:boolean || false, maxWidth:number || 300])
let dialog
dialog = popup([
{tag: 'h1', text: 'Hello World'},
{tag: 'input', type: 'button', value: 'Close Dialog', onclick: () => dialog.close()}
])
// you can readjust the maxWidth with the method below
dialog.setWidth(500)
// close the dialog with the method below
dialog.close()
You can apply additional styles with the below class names:
.c-popup {}
.c-blur {}
See crelm for more on the children elements.