Skip to main content

WebOptions

Browser-specific presentation options for Notifications.show.

Note

Individual options may be ignored depending on the browser and operating system. Notification permission is still required. Image URLs must be accessible to the browser; local Python file paths are not resolved or uploaded by these options.

See the browser notification options for platform support and restrictions.

Properties

  • badge_url - URL of a compact image used where the full notification icon will not fit.
  • direction - Requested text direction.
  • icon_url - URL of an image displayed alongside the notification's title and body.
  • image_url - URL of a larger image displayed within the notification's content.
  • lang - BCP 47 language tag for the content, such as "en-GB" or "ja-JP".
  • renotify - Whether replacing a notification should alert the user again.
  • require_interaction - Request that the notification remain visible until clicked or dismissed.
  • silent - Whether to suppress notification sound and vibration.
  • timestamp - Time associated with the notification's event.

Properties​

badge_urlclass-attributeinstance-attribute​

badge_url: str | None = None

URL of a compact image used where the full notification icon will not fit.

Some platforms mask this image to a monochrome silhouette.

directionclass-attributeinstance-attribute​

direction: WebDirection | None = None

Requested text direction.

The browser may ignore this hint.

icon_urlclass-attributeinstance-attribute​

icon_url: str | None = None

URL of an image displayed alongside the notification's title and body.

image_urlclass-attributeinstance-attribute​

image_url: str | None = None

URL of a larger image displayed within the notification's content.

langclass-attributeinstance-attribute​

lang: str | None = None

BCP 47 language tag for the content, such as "en-GB" or "ja-JP".

This labels the language; it does not translate the title or body.

renotifyclass-attributeinstance-attribute​

renotify: bool | None = None

Whether replacing a notification should alert the user again.

Call Notifications.show with the same id to replace a notification. The backend uses that ID as the browser notification tag. Sound can still be suppressed by silent or user settings.

require_interactionclass-attributeinstance-attribute​

require_interaction: bool | None = None

Request that the notification remain visible until clicked or dismissed.

The browser and operating system determine whether this request is honored.

silentclass-attributeinstance-attribute​

silent: bool | None = None

Whether to suppress notification sound and vibration.

False permits alerting but does not override browser or system sound settings.

timestampclass-attributeinstance-attribute​

timestamp: datetime | None = None

Time associated with the notification's event.

Can represent an earlier event, such as a message received while offline. This is display metadata; it does not schedule notification delivery.

Timezone-aware values preserve their instant. A naive datetime is interpreted in the Python host's local timezone.