@tiny-components/confirm

0.1.1 • Public • Published

Tiny Components - confirm

Created with Riot.js and using Plain-UI and Observable

A small modal to confirm or cancel an Action.

demo

Install

npm install @tiny-components\confirm --save

You can use it like this

Add tiny-confirm globally in an App. Open and Closing will be done by store.js

import TinyConfirm from './confirm.riot'
riot.register('tiny-confirm', TinyConfirm)
riot.mount('tiny-confirm')
<tiny-confirm></tiny-confirm>

Use a function to open tiny-confirm and callbacks. "Cancel" is optional.

handleOpen() {

    // open
    store.trigger('open', {
        title: 'Question',
        content: 'Are you sure?'
    })

    // handle confirm
    store.confirm(() => {

    })

    // handle cancel
    store.cancel(() => {

    })
},

Readme

Keywords

none

Package Sidebar

Install

npm i @tiny-components/confirm

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

1.15 MB

Total Files

24

Last publish

Collaborators

  • node001.net