Skip to main content
Neural Nativev0.1.0-beta.1Documentation

Import

component.ts
import { NeuConfirmDialogComponent } from '@neural-ui/native/confirm-dialog';

Examples

Import ExampleComponent into its parent and place <app-example /> inside your application’s root neu-theme. The preview supplies the device frame and safe areas; use the root setup from Installation in your app.

Basic

Request deletion of the project, then choose whether to proceed or keep it. The example records the decision; your application performs the actual deletion.

View and copy the complete example
basic.component.ts
import { Component, signal } from '@angular/core';
import { NeuButtonComponent } from '@neural-ui/native/button';
import { NeuConfirmDialogComponent } from '@neural-ui/native/confirm-dialog';
import { View, Text } from '@ng-native/components';

@Component({
  selector: 'app-example',
  imports: [NeuButtonComponent, NeuConfirmDialogComponent, View, Text],
  template: `
    <view class="confirmation-example">
      <neu-button label="Delete project" size="sm" variant="outline" tone="danger" (pressed)="open.set(true)" />
      <text accessibilityLiveRegion="polite">{{ deleted() ? 'Example project deleted' : 'Project is still available' }}</text>
    </view>
    <neu-confirm-dialog title="Delete Mobile launch?" message="This removes the project from your workspace. This action cannot be undone." confirmLabel="Delete" cancelLabel="Cancel" intent="danger" [showCloseButton]="true" [(open)]="open" (confirmed)="deleteProject()" />
  `,
  styles: `
.actions { gap: 12px; align-items: flex-start; } text { color: var(--neu-text, #172033); font-size: 16px; }
.confirmation-example { gap: 12px; }
  `,
})
export class ExampleComponent {
  readonly open = signal(false);
  readonly deleted = signal(false);
  deleteProject(): void {
    this.deleted.set(true);
  }
}
Interactive playground

Change the settings and try the result.

Device captures shown in English.

Confirm Dialog · android · native capture
AndroidNative screenshot
Confirm Dialog · ios · native capture
iOSNative screenshot

API reference

Inputs

NameTypeDefaultBindingDescription
titlestringRequiredInputHeading for the surface, section or presentation.
messagestringRequiredInputMessage shown to explain a status, notification or decision.
confirmLabelstring'Confirm'InputText or accessible name used for confirm. It does not perform the action by itself.
cancelLabelstring'Cancel'InputText or accessible name used for cancel. It does not perform the action by itself.
intent"danger" | "default"'default'InputUse danger for a destructive confirmation. It changes the primary action color, never the application action itself.
busybooleanfalseInputKeeps a confirmation in progress and disables its actions while your application completes the task.
showCloseButtonbooleantrueInputShows an X at the top right. Closing through it emits cancelled and updates open. The X is hidden while busy prevents dismissal. Enabled by default.
closeLabelstring'Close'InputAccessible name of the header X, independent of cancelLabel. Defaults to Close; customize it for the app language.
closeOnConfirmbooleantrueInputCloses the dialog and updates open before emitting confirmed. Enabled by default. Set false for an asynchronous operation: bind busy while it runs and close open only after success.

Models

NameTypeDefaultBindingDescription
openbooleanfalseModel · two-wayWhether the presentation or message is requested to be open. Bind a writable signal with [(open)].

Outputs

NamePayloadWhen it emits
openChangebooleanEmits the updated open value. [(open)] binds this output together with its model input.
confirmedvoidRequests confirmation. Perform the actual operation in your application handler.
cancelledvoidReports cancellation of the current editing or confirmation task.
openedvoidReports that the native presentation has opened.
dismissedvoidReports completion of native dismissal.

Model state

Bind the signal with [(modelName)] without calling it. Use modelName() to read its value.

model-fields.ts
import { signal } from '@angular/core';

// Fields inside your component class
readonly open = signal<boolean>(false);