Bewerken

Delen via


Toast schema

These elements and their attributes are manipulated through Document Object Model (DOM) manipulation functions to customize the toast content.

To define the content for a toast, you can use ToastNotificationManager.getTemplateContent to get a toast template that can be modified.

To examine the content of an existing toast, use ToastNotification.content to get the current contents.

The following table lists all of the elements in this schema, sorted alphabetically by name.

Element Description
audio

Specifies a sound to play when a toast notification is displayed. This element also allows you to mute any toast notification audio.

binding

Specifies the toast template. Note that only one binding element can be included in a toast notification.

command

Specifies a scenario-associated button shown in a toast. The scenario is specified in the parent commands element.

commands

Specifies that the toast notification is being used to indicate an incoming call or an alarm, with appropriate commands associated with each scenario.

image

Specifies an image used in the toast template.

text

Specifies text used in the toast template.

toast

Base toast element, which contains at least a single visual element.

visual

Contains a single binding element that defines a toast.

header

Specifies a custom header that groups multiple notifications together within Action Center.

action

Specifies a button shown in a toast.

actions

Container element for declaring up to five inputs and up to five button actions for the toast notification.

progress

Specifies a progress bar for a toast notification.

group

Semantically identifies that the content in the group must either be displayed as a whole, or not displayed if it cannot fit. Groups also allow creating multiple columns.

subgroup

Specifies vertical columns that can contain text and images.