0.2.1 • Published 2 years ago

@migueleraso/alerts_components v0.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Alerts and toasts for javascript

demos: https://migueldavideraso.github.io/demos/alerts_components/

import { useToast, useAlert } from '@migueleraso/alerts_components'

const successToast = useToast({
	defaultMessage: 'Success',
    // type: success, info, warning, danger, dark, light
	type: 'success',
	duration: 3000, // default 5000
	// positions: top-left, top-right, bottom-right, bottom-left
	position: 'bottom-left',
	dismissable: true,
	onDismiss: (args) => {
		console.log(args)
	}
})

successToast('Success toast')

window.useAlert = async () => {

	const result = await useAlert({
		message: 'This is an alert',
		accept: 'Accept',
		cancel: 'Cancel',
		// showCancelButton: false, // Confirm
		/*
		    // Prompt
    		inputs: [
    			{
    				label: 'Name',
    				name: 'name',
    				type: 'text',
    				placeholder: 'Enter your name'
    			},
    			{
    				label: 'Age',
    				name: 'age',
    				type: 'number',
    				placeholder: 'Enter your age'
    			},
    			{
    				type: 'textarea'
    			}
    		]
		*/
	})
	console.log(result)
}
0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago