bootstack.confirm#

bootstack.confirm(message, *, title='', confirm_text='Yes', cancel_text='No', confirm_role='primary', severity=None, icon=None, sound=None, parent=None)#

Show a confirmation dialog.

Parameters:
  • message (str) – The question text to display.

  • title (str) – Dialog window title.

  • confirm_text (str) – Label for the confirm button. Defaults to 'Yes'.

  • cancel_text (str) – Label for the cancel button. Defaults to 'No'.

  • confirm_role (Literal['primary', 'secondary', 'danger', 'cancel']) – Button role controlling styling. Use 'danger' for destructive actions, 'primary' (default) for standard confirmations. When 'danger', the confirm button is not focused by default so Enter does not accidentally trigger it. Automatically overridden to 'danger' when severity='danger' and to warning styling when severity='warning', unless set explicitly.

  • severity (SeverityToken | None) – Visual severity level — sets a colored icon, adjusts the confirm button color for 'danger' and 'warning', and controls the default sound behavior.

  • icon (str | None) – Icon name override. Takes precedence over severity.

  • sound (bool | None) – Override the alert sound. True always rings the bell, False always suppresses it. None (default) defers to severity: rings for 'warning' and 'danger', silent otherwise.

  • parent (Any) – Parent widget. Defaults to the active root window.

Returns:

True if the user clicked the confirm button, False otherwise.

Return type:

bool