ToastNotification#
ToastNotification is a helper that ttkbootstrap ships
(ttk.ToastNotification) — a small, semi-transparent popup for temporary
alerts. It is not a widget: you construct it, then call
show_toast() to display it. A toast either closes itself after
duration milliseconds or waits to be clicked. Concurrent toasts anchored to
the same corner stack without overlapping.
Options#
All options are passed to the constructor.
Option |
Type |
Description |
|---|---|---|
|
|
The bold heading line of the toast. |
|
|
The body text of the toast. |
|
|
The color of the toast — one of |
|
|
Milliseconds to keep the toast visible. Default |
|
|
Whether to ring the display bell when the toast appears. Default
|
|
|
A Bootstrap-Icons glyph name (e.g. |
|
|
An |
Methods#
- show_toast()
Create, position, and display the toast.
- Returns:
the toast itself, usable as a dismiss handle.
- hide()
Dismiss the toast immediately: it leaves its corner stack (the remaining toasts reflow to close the gap), fades out, and is destroyed. Idempotent and safe to call on a toast that was never shown.
hide_toast()is a back-compat alias.- Returns:
None.
See also#
ToastNotification catalog page — usage, screenshots, and examples.