The <std-toast> HTML element will let developers add more controlled custom views to their toasts. However, there are certain commonly used patterns for toasts (e.g. the "Snackbar" pattern of message and action) that it could be advantageous to natively support.
The toast could know to use the <p> element as the message and the <button> element as the action. Are patterns like this prevalent enough that this should work out of the box? If so, what are those patterns (#17)?
Additionally, if we use Shadow DOM for displaying toast content, how should we manage capturing the patterns and putting them in the right place? Like this:
The
<std-toast>
HTML element will let developers add more controlled custom views to their toasts. However, there are certain commonly used patterns for toasts (e.g. the "Snackbar" pattern ofmessage
andaction
) that it could be advantageous to natively support.For instance, if a developer writes this:
The toast could know to use the
<p>
element as the message and the<button>
element as the action. Are patterns like this prevalent enough that this should work out of the box? If so, what are those patterns (#17)?Additionally, if we use Shadow DOM for displaying toast content, how should we manage capturing the patterns and putting them in the right place? Like this:
Like this:
Or is there a better way?