ui/ConfirmButton.svelte

Confirmation popover wrapping PopoverButton.

Clicking the trigger opens a popover with a confirm button. On confirm, calls onconfirm and hides the popover (controlled by hide_on_confirm). Defaults to position="left".

Snippets (children, popover_content, popover_button_content) receive both the Popover instance and a confirm callback.

@example

<ConfirmButton onconfirm={() => delete_item(item.id)} title="delete item" disabled={deleting} > {#snippet children(_popover, _confirm)} {deleting ? 'deleting…' : 'delete'} {/snippet} </ConfirmButton>

@example

<!-- custom confirm button content --> <ConfirmButton onconfirm={handle_revoke} class="icon_button plain" title="revoke"> revoke {#snippet popover_button_content()}revoke{/snippet} </ConfirmButton>

Declarations
#

view source

ConfirmButton
#

ui/ConfirmButton.svelte view source

onconfirm

type (popover: Popover) => void

popover_button_attrs?

type SvelteHTMLElements['button'] | undefined
optional

hide_on_confirm?

type boolean | undefined
optional

popover_content?

Unlike on PopoverButton this is optional and has a confirm arg

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

popover_button_content?

Content for the popover button

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

children?

Unlike on PopoverButton this has a confirm arg

type Snippet<[popover: Popover, confirm: () => void]> | undefined
optional

Depends on
#

Imported by
#