<divclass="demo-row"><buttonsoneBtnvariant="outline"type="button" (click)="renameOpen.set(true)">Rename note…</button><buttonsoneBtnvariant="destructive"type="button" (click)="deleteOpen.set(true)">Delete note…</button><buttonsoneBtnvariant="ghost"type="button" (click)="detailsOpen.set(true)">Note details</button></div>
@if (renameOpen()) {
<sone-dialog (dismiss)="renameOpen.set(false)"><headersoneDialogHeader><h2soneDialogTitle>Rename note</h2><psoneDialogDescription>The new name shows everywhere this note appears.</p></header><divsoneField><labelsoneFieldLabelfor="rename-note">Name</label><inputid="rename-note"type="text"value="Q4 planning"data-autofocus="select" /></div><divsoneField><spansoneFieldLabelid="rename-folder-label">Folder</span><buttonsoneBtnvariant="outline"type="button"aria-describedby="rename-folder-label"
[sonePopoverTrigger]="folderPicker">{{ folder() }}</button><ng-template #folderPickerlet-close="close"><divsonePopoverrole="dialog"aria-label="Choose a folder">
@for (f of folders; track f) {
<buttonsoneBtnvariant="ghost"size="sm"type="button" (click)="folder.set(f); close()">{{ f }}</button>
}
</div></ng-template></div><footersoneDialogFooter><buttonsoneBtnvariant="outline"type="button" (click)="renameOpen.set(false)">Cancel</button><buttonsoneBtntype="button" (click)="renameOpen.set(false)">Save</button></footer></sone-dialog>
}
@if (deleteOpen()) {
<sone-alert-dialog (dismiss)="deleteOpen.set(false)"><headersoneDialogHeader><h2soneDialogTitle>Delete “Q4 planning”?</h2><psoneDialogDescription>The note moves to Trash. You can restore it for 30 days.</p></header><footersoneDialogFooter><buttonsoneBtnvariant="outline"type="button"data-autofocus (click)="deleteOpen.set(false)">Cancel</button><buttonsoneBtnvariant="destructive"type="button" (click)="deleteOpen.set(false)">Delete</button></footer></sone-alert-dialog>
}
<!-- Stays mounted: [(open)] shows and hides it, and a dismissal sets it back to false. --><sone-dialog [(open)]="detailsOpen"size="xs"><headersoneDialogHeader><h2soneDialogTitle>Note details</h2><psoneDialogDescription>Created on 2 October by Ana Silva.</p></header><footersoneDialogFooter><buttonsoneBtntype="button" (click)="detailsOpen.set(false)">Done</button></footer></sone-dialog>
Shown or not, two-way: `[(open)]`. Leave it unbound to show the overlay while it is mounted (render it with `@if` and close it on `(dismiss)`).
boolean | undefined
undefined
dismissible
boolean
true
showClose
boolean
true
closeLabel
—
$localize`:verb|Closes a dialog or sheet:Close`
ariaLabel
string | null
null
size
"xs" | "md"
"md"
Output
Nome
Tipo
dismiss
void
SoneDialogCloseComponentComponente
`button[soneDialogClose]` — a close button for a dialog or sheet header. Inside an overlay it closes it (when it may be dismissed) and the corner close steps aside. Project your own glyph to replace the default cross.