Confirm

Une confirmation en place plutôt qu’une modale : titre, description et erreur, Annuler puis Confirmer, focus sur l’action, Échap pour annuler et un état occupé.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Utilisation

Remove the lock from “Board”?

Its notes are decrypted and stay readable without Touch ID.

Importation

ts
import {
  SoneConfirmActionsDirective,
  SoneConfirmComponent,
  SoneConfirmDescriptionDirective,
  SoneConfirmErrorDirective,
  SoneConfirmTitleDirective,
} from "@surface-one/angular/confirm";

Référence de l’API

SoneConfirmActionsDirectiveDirective

`[soneConfirmActions]` — extra controls at the start of the button row (a "Don't ask again" checkbox).

Sélecteur
[soneConfirmActions]

SoneConfirmComponentComposant

`[soneConfirm]` — an inline confirmation: the shadcn/ui Alert Dialog anatomy (title, description, Cancel then the action) rendered in place, in a row or a list, instead of in a modal. Render it with `@if` when the user asks to delete / discard / leave; it is a `role="alertdialog"` named by its `[soneConfirmTitle]` (or your `aria-label`) and described by its `[soneConfirmDescription]` and `[soneConfirmError]`. The buttons are drawn for you, always Cancel then Confirm. Focus moves to the Confirm button when it opens, Escape cancels, and while `busy` both buttons are `aria-disabled` (focus stays put) and the action shows `busyLabel` with a spinner. Extra controls in `[soneConfirmActions]` sit at the start of the button row. Give focus back to the control that opened it on `(cancel)`.

Sélecteur
[soneConfirm]
Exporté sous
soneConfirm
Inputs
NomType Par défaut
variant

`destructive` paints the action red (delete, discard, leave).

ConfirmVariant"default"
size

`compact` uses extra-small buttons and tighter spacing — for a list row.

ConfirmSize"default"
layout

`inline`: text and buttons share one wrapping row. `card`: a bordered panel, buttons below.

ConfirmLayout"inline"
confirmLabel

The action button's label.

—$localize`Confirm`
cancelLabel

The cancel button's label.

—$localize`Cancel`
busyLabel

The action button's label while `busy`.

—$localize`Working…`
busy

The action is running: both buttons are disabled and the action shows `busyLabel`.

booleanfalse
autoFocus

Move focus to the Confirm button when the confirmation renders (default `true`).

booleantrue
Outputs
NomType
confirm

The user confirmed (click on the action; never while `busy`).

void
cancel

The user cancelled (the Cancel button or Escape; never while `busy`).

void

SoneConfirmDescriptionDirectiveDirective

`[soneConfirmDescription]` — the consequence ("This cannot be undone.").

Sélecteur
[soneConfirmDescription]

SoneConfirmErrorDirectiveDirective

`[soneConfirmError]` — why the last attempt failed; announced with `role="alert"`.

Sélecteur
[soneConfirmError]

SoneConfirmTitleDirectiveDirective

`[soneConfirmTitle]` — the question; names the alertdialog.

Sélecteur
[soneConfirmTitle]