The DialogBuilder provides an easy to use interface for creating simple dialogs in consistent Nextcloud design

// It is recommended to use `getDialogBuilder` instead
const dialogBuilder = new DialogBuilder('The dialog title')
const dialog = dialogBuilder
.setText('The dialog message')
.setSeverity(DialogSeverity.Warning)
.addButton({
label: 'Ok',
callback: () => console.warn('Warning was dismissed'),
})
.build()

Constructors

Methods

  • Add a single button

    Parameters

    Returns this

  • Returns Dialog

  • Set buttons from array

    Parameters

    Returns this

  • Set dialog name

    Parameters

    • name: string

      The name or headline of the dialog

    Returns this

  • Set the severity of the dialog

    Parameters

    Returns this

  • Set the dialog text

    Parameters

    • text: string

      Main text of the dialog

    Returns this