Skip to content
tcpsystemsui

Theme

Colour scheme
Accent
Density
Radius
Esc

ConfirmPopover

An inline confirmation beside the button that asked, with Cancel focused first.

beta

Try it

Remove Dana Whitfield from the team?

Svelte
<ConfirmPopover id="playground-confirm" label="Remove member" question="Remove Dana Whitfield from the team?" confirmLabel="Remove" />

Examples

Remove member

Remove Dana Whitfield from the team?

Remove member.svelte
<script lang="ts">
	import ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';
	const uid = $props.id();
	let removed = $state(false);
</script>

{#if removed}
	<p>Dana Whitfield was removed from the team.</p>
{:else}
	<ConfirmPopover id={uid} label="Remove member" question="Remove Dana Whitfield from the team?" confirmLabel="Remove" onconfirm={() => (removed = true)} />
{/if}

With detail

Purge the edge cache?

The next 2,000 requests will hit the origin while the cache warms.

With detail.svelte
<script lang="ts">
	import ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';
	const uid = $props.id();
</script>

<ConfirmPopover id={uid} label="Purge cache" question="Purge the edge cache?" confirmLabel="Purge">
	<p>The next 2,000 requests will hit the origin while the cache warms.</p>
</ConfirmPopover>

Neutral

Pause nightly sync?

Neutral.svelte
<script lang="ts">
	import ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';
	const uid = $props.id();
	let paused = $state(false);
</script>

<ConfirmPopover id={uid} label={paused ? 'Paused' : 'Pause sync'} tone="neutral" question="Pause nightly sync?" confirmLabel="Pause" cancelLabel="Keep running" onconfirm={() => (paused = true)} />

Pending

Delete backup from 2 Nov?

Deleting 4.2 GB…

Pending.svelte
<script lang="ts">
	import ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';
	const uid = $props.id();
</script>

<ConfirmPopover id={uid} label="Delete backup" question="Delete backup from 2 Nov?" confirmLabel="Delete" pending>
	<p>Deleting 4.2 GB…</p>
</ConfirmPopover>

API

Import
import ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';
PropTypeDefault
idstringnone
labelstringnone
questionstringnone
confirmLabelstringnone
cancelLabel?string'Cancel'
tone?'danger' | 'neutral''danger'
pending?booleanfalse
Snippet
children
HookKind
.tcp-popRoot class
data-sizeData attribute
data-variantData attribute