Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
ConfiguratorUsageAccessibilityAPI
Toast The p-toast component manages both, the queue and display of toast messages. Therefore, you can only have a single instance of this component within your application. Its messages are rendered on the #top-layer which ensures the element to be on top of the page, independent of where p-toast is placed in the DOM hierarchy (z-index is not relevant anymore and won't have any effect). Review the notification decision tree to determine which notification component is best for a particular scenario. Queuing messages on p-toast component happens via its addMessage() method. For Angular users, we offer the injectable ToastManager service, for React, there is the useToastManager() hook. Both expose the addMessage() method, which needs to be called with a parameter that has the following structure:
type ToastMessage = { text: string; state?: 'info' | 'success'; };
The bottom position of the p-toast can be adjusted via the --p-toast-position-bottom CSS variable.
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<button type="button">Queue Toast</button>
<p-toast></p-toast>
<script>
  const toast = document.querySelector('p-toast');
  let counter = 1;

  customElements.whenDefined('p-toast').then(() => {
    document.querySelector('button').addEventListener('click', () => {
      toast.addMessage({ text: `Some message ${counter}`, state: 'success' });
      counter++;
    });
  });
</script>
</body>
</html>
Global settingsThemeChanges the theme of the application and any Porsche Design System component. It's possible to choose between forced theme light and dark. It's also possible to use auto, which applies light or dark theme depending on the operating system settings automatically.LightDarkAuto (sync with operating system)DirectionThe dir global attribute in HTML changes the direction of text and other content within an element. It's most often used on the <html> tag to set the entire page's direction, which is crucial for supporting languages that are written from right to left (RTL), such as Arabic and Hebrew. For example, using <html dir="rtl"> makes the entire page display from right to left, adjusting the layout and text flow accordingly.LTR (left-to-right)RTL (right-to-left)Text ZoomTo ensure accessibility and comply with WCAG 2.2 AA standards, it is mandatory for web content to support text resizing up to at least 200% without loss of content or functionality. Using relative units like rem is a best practice for achieving this, as they allow the text to scale uniformly based on the user's browser settings.100%130%150%200%