ConfirmPopover
An inline confirmation beside the button that asked, with Cancel focused first.
beta
Try it
Remove Dana Whitfield from the team?
<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?
<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.
<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?
<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…
<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 ConfirmPopover from '@tcpsystems/ui/foundation/ConfirmPopover';| Prop | Type | Default |
|---|---|---|
id | string | none |
label | string | none |
question | string | none |
confirmLabel | string | none |
cancelLabel? | string | 'Cancel' |
tone? | 'danger' | 'neutral' | 'danger' |
pending? | boolean | false |
| Snippet |
|---|
children |
| Hook | Kind |
|---|---|
.tcp-pop | Root class |
data-size | Data attribute |
data-variant | Data attribute |