Feedback

InlineConfirm

In-flow confirmation for reversible actions without modal interruption.

import { InlineConfirm } from '@lostgradient/cinder/inline-confirm';
01

Overview

InlineConfirm keeps a confirmation in document flow for reversible actions. It uses a labelled role="group", focuses Cancel on open, and restores focus to the trigger when dismissed.

Usage

svelte
<script lang="ts">
  import { Button } from '@lostgradient/cinder/button';
  import { InlineConfirm } from '@lostgradient/cinder/inline-confirm';

  let open = $state(false);

  function removeWorkspace() {
    open = false;
  }
</script>

<Button variant="danger" onclick={() => (open = true)}>Remove workspace</Button>
<InlineConfirm
  prompt="Remove this workspace?"
  confirmLabel="Remove workspace"
  bind:open
  destructive
  onConfirm={removeWorkspace}
/>
Live preview

Remove this workspace?

02

When to use

Use when
  • Confirming a reversible action in the same flow as its trigger.
Avoid when
  • The action requires modal interruption or extensive consequences; use ConfirmDialog.
03

Examples

Basic inline confirmation

Confirm a destructive action without leaving the current flow.

04

Props

Props for inline-confirm
Name
Type
Default
Description
prompt required text
confirmLabel required text
cancelLabel text 'Cancel'
destructive boolean false
open bindable boolean false
onConfirm () => void
onCancel () => void
children snippet