@tadashi/svelte-dialog
v5.0.2
Published
[![NPM version][npm-img]][npm] [![Build Status][ci-img]][ci]
Downloads
37
Readme
svelte-dialog
Dialog - Svelte component
Install
$ npm i -S @tadashi/svelte-dialog
Props
| property | type | required | default | description | | -------------- | --------- | -------- | --------- | --------------------------- | | name | String | no | undefined | unique name (like a ID) | | open | Boolean | no | false | dialog state | | component | Component | yes | undefined | Svelte Component | | componentProps | Object | no | {} | Svelte Component properties |
Usage
You can see more examples here: https://svelte.dev/repl/69a508aaf3a342cd88a82c35241c5e31?version=3.59.0
<script>
import {Dialog, acts} from '@tadashi/svelte-dialog'
import Exemplo from './Exemplo.svelte'
const unique = {
name: 'exemplo',
component: Exemplo,
componentProps: {
title: 'Apenas um exemplo',
message: 'Tá deprimidis, eu conheço uma cachacis que pode alegrar sua vidis',
},
}
</script>
<button on:click="{() => acts.open('exemplo')}">Dialog Unique</button>
<button on:click="{() => acts.open()}">Dialog</button>
<Dialog {...unique} />
<Dialog />
Donate ❤️
- BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4
- PIX: [email protected]
License
MIT © Thiago Lagden