bootstack.snackbar#

bootstack.snackbar(message, *, action=None, on_action=None, align='center', duration=5000, accent=None, on_dismiss=None)#

Show a snackbar at the window’s bottom edge, and return immediately.

The one-line form of Snackbar — see it for the full description. Use the class when you need a handle to dismiss() early.

Parameters:
  • message (str) – Body text of the snackbar.

  • action (str | None) – Label for the optional action button (e.g. 'Undo').

  • on_action (Callable[[], Any] | None) – Called with no arguments when the action is pressed.

  • align (Literal['left', 'center', 'right']) – Bottom-edge alignment — 'left', 'center', or 'right'. Defaults to 'center'.

  • duration (int) – Time on screen in milliseconds. Defaults to 5000.

  • accent (AccentToken | str | None) – Semantic color accent for the action button (the surface stays neutral). No effect without an action.

  • on_dismiss (Callable[[], Any] | None) – Called with no arguments when the snackbar dismisses.