@danicastar/html-dialog
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

html-dialog

This just a demo. so it looks ugly. but you can see code to learn html5 skills.

Usage

  <div>
    <h1>Hello</h1>
    <button id="op">open</button>
  </div>

  <script type="module">
  	import { init,create } from './index.js'
  	
    let btn_open = document.getElementById('op')
    
    btn_open.onclick=function(){
    	// init api
    	init({
    		// enable showModal
    		modal:true,
    		// add some styles for you
    		css:true,
    		// some styles config (if css true)
    		backdropColor: 'red',
    		bdColor: 'blue',
    		bgColor: 'green'
    	})
    	// create a dialog, can't open > 1 dialog one time
    	create({
    		closeText: 'undo',
    		title: 'Title',
    		// can be HTML
    		texts: '<b>hello dialog</b>'
    	},()=> {
    		console.log('callback')
    	})
    	
    }
  </script>

Readme

Keywords

Package Sidebar

Install

npm i @danicastar/html-dialog

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.45 kB

Total Files

6

Last publish

Collaborators

  • danicastar