Anatomy
Import the primitives and assemble the parts. The viewport holds stacked toasts, each a ToastRoot, and anchored toasts, each a ToastRoot in a ToastPositioner:
@using Blazix.Primitives
<ToastProvider>
<ToastPortal>
<ToastViewport>
<ToastRoot>
<ToastContent>
<ToastTitle />
<ToastDescription />
<ToastAction />
<ToastClose />
</ToastContent>
</ToastRoot>
<ToastPositioner>
<ToastRoot>
<ToastArrow />
<ToastContent>
<ToastTitle />
<ToastDescription />
<ToastAction />
<ToastClose />
</ToastContent>
</ToastRoot>
</ToastPositioner>
</ToastViewport>
</ToastPortal>
</ToastProvider>API Reference
ToastRoot
Renders a <div> element.
Other attributes are passed to the element it renders.
ToastProvider
Doesn't render its own HTML element.
ToastPortal
Doesn't render its own HTML element.
ToastPositioner
Renders a <div> element.
Other attributes are passed to the element it renders.
ToastArrow
Renders a <div> element.
Other attributes are passed to the element it renders.
ToastContent
Renders a <div> element.
Other attributes are passed to the element it renders.
ToastTitle
Renders a <h2> element.
Other attributes are passed to the element it renders.
ToastDescription
Renders a <p> element.
Other attributes are passed to the element it renders.
ToastClose
Renders a <button> element.
Other attributes are passed to the element it renders.
ToastAction
Renders a <button> element.
Other attributes are passed to the element it renders.
ToastViewport
Renders a <div> element.
Other attributes are passed to the element it renders.