svelte-dialog Svelte Themes

Svelte Dialog

Svelte component

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 />

License

MIT © Thiago Lagden

Top categories

Loading Svelte Themes