Design System

Toast reference ​

The prop, the slot, the message payload and every rendered element, with what each one carries. For what a toast is for, see Overview. For how to mount one, see Usage.

CToast and useToast are exported from @proxy-frontend/components.

Props ​

PropTypeRequiredDefaultMeaning
groupstringNoAbsentWhich messages this host draws. A host with no group draws messages that carry no group, and a host with a group draws only messages carrying that same string

There is no size prop, no severity prop and no position prop. Variation reaches a toast through the message rather than through the element.

Events ​

EventPayloadDeclared by the component
close{ message }No. It arrives as a listener and is bound onto the element underneath. It fires on a click of the close control, and when the three message cap removes the oldest
life-end{ message }No. It arrives the same way, and fires when a message reaches the end of its life

The component binds its own close handler as well, which removes the message from the count it keeps.

Slots ​

SlotScopeNotes
message{ message }Replaces the icon, the title and the detail for every message this host draws. The close control remains. Nothing wraps the content, so it sets its own width behaviour
defaultNoneDoes not exist. Content written between the tags is never rendered
container, messageicon, icon, closeiconNoneNot exposed. The component forwards one template and passes no others

Severities ​

SeverityBackgroundTextDetailIcon
infosurface-toast-infofg-info-strongfg-strongInformation circle
successsurface-toast-successfg-success-strongfg-strongCheck
warnsurface-toast-warnfg-warn-strongfg-strongWarning triangle
errorsurface-toast-dangerfg-danger-strongfg-strongTimes circle
secondarysurface-raisedfg-defaultfg-strongNone
contrastfill-neutral-subtlefg-on-neutral-subtlefg-on-neutral-subtleNone
AbsentNone, so the message is transparentInheritedfg-strongNone, though the space for one is still reserved

The failing case is spelled error here and danger in the shared severity vocabulary that Components records. A message sent with danger falls into the last row.

Message payload ​

KeyTypeMeaning
severityOne of the six names abovePicks the surface, the text colour and the icon. Absent leaves the surface and the text colour unset, and reserves the icon space without an icon
summarystringThe title line. The composable takes it from the message catalogue
detailstringThe body line. The composable takes it from the call
lifenumberMilliseconds before the message removes itself. Absent leaves the message until it is dismissed
groupstringRoutes the message to the host carrying the same string
closablebooleanfalse removes the close control and the container around it. The default is true
styleClassstringA class on the message element, and one of the two routes a class has into a toast
contentStyleClassstringA class on the content row, and the other route

Measured contrast ​

PairingLightDark
fg-info-strong on surface-toast-info8.204.54
fg-success-strong on surface-toast-success7.615.07
fg-warn-strong on surface-toast-warn8.064.83
fg-danger-strong on surface-toast-danger7.965.16
fg-default on surface-raised8.907.48
fg-on-neutral-subtle on fill-neutral-subtle9.447.32
fg-strong on the four toast surfaces11.36 to 12.406.26 to 7.42
fg-on-info on surface-toast-info1.407.51

The composable ​

CallSeverityTitleLifetime
notifyError(message, options)errorErrorNone, so it waits to be dismissed
notifyWarning(message, options)warnWarningNone, so it waits to be dismissed
notifyInfo(message, options)infoInfo3000ms plus 333ms per word, floored at 4000 and capped at 12000
notifySuccess(message, options)successSuccessThe same calculation

options carries one key, duration, in milliseconds, which replaces the lifetime above. Three places pass one: the frontend SDK, which hands a plugin author's value straight through, one replay error path at 4000ms, and the AI provider error path at 5000ms. secondary and contrast are outside the composable and reachable only by pushing a message onto the bus directly.

Attributes ​

PassedReaches the column
data-*Yes
aria-*Yes
A listenerYes
id, name, formYes
classNo
styleNo
position, pt, closeIcon, closeButtonProps, breakpoints, baseZIndexNo. They are props of the element underneath, and the component neither declares nor forwards them

The component sets inheritAttrs to false and forwards through one allow-list, which is the filter Components describes for the layer.

Fixed behaviour ​

SettingValue
Positionbottom-center, written inside the component
Render targetThe end of document.body, from the mounted hook onwards
Stacking layerAn inline z-index, written when the first message enters and seeded from the floating layer at 100, so the rendered value is 101 or higher. The root carries no layer class
Visible at once3, counted in one module-level array shared by every caller of the composable
EvictionThe oldest is removed when a fourth arrives
Messages pushed onto the bus directlyOutside that count, so neither evicted nor counted
Pass-throughThe component supplies its own, which merges with the preset. One written at a call site is dropped by the attribute filter

Rendered elements ​

ElementMarkerCarries
divdata-pc-name="toast", data-pc-section="root"The fixed position, the 384px width and the 6px corner
divNoneThe transition group holding the messages
divdata-pc-section="message"Background, text colour, corner, bottom margin and the backdrop blur
divdata-pc-section="messagecontent"The 12px padding and the row of icon, text and close control
svg or spandata-pc-section="messageicon"The severity glyph, or zero width for secondary and contrast
divdata-pc-section="messagetext"The body role, the left gutter and the growth of the text column
spandata-pc-section="summary"The title, at weight 500
divdata-pc-section="detail"The message text, at the caption role
divdata-pc-section="buttoncontainer"The close control
buttondata-pc-section="closebutton"A 28px circle holding a 14px glyph
svgdata-pc-section="closeicon"The 14px cross, sized by the icon defaults rather than by the preset

ARIA ​

AttributeValueSet by
role on a messagealert for error and warn, status otherwiseThe pass-through, which wins over the library default of alert
aria-live on a messageassertive for error and warn, polite otherwiseThe same pass-through, and the reason an info toast waits its turn
aria-atomic on a messagetrueThe component library
aria-label on the close controlCloseThe library locale default. It sits outside the translation layer and stays in English
autofocus on the close controlPresentThe component library. There is no route to remove it
aria-hidden on each glyphtrueThe icon component, because neither glyph is labelled
The root and the transition groupNo role and no live regionNeither element is announced

Feedback carries the same politeness table alongside the other indicators.

Geometry ​

PartValue
ColumnFixed, 20px above the bottom edge, centred by a 50 per cent translation
Column width384px, independent of the text size setting
Message corner6px, with no border and no shadow
Message bottom margin16px, which the lowest message keeps, so the visible gap to the edge is 36px
Message backdropA 10px blur
Content padding12px on all four sides
Icon15.75px square, 8px to its right
Gutter between icon and text16px, from the 8px on each side
Text columnThe body role at 14px, growing to fill the row
TitleWeight 500, on its own line
DetailThe caption role at 12px on a 16px line, 8px below the title
Close control28px square, fully rounded, transparent until hover
Message height65px with a detail. 52px without one, because the 28px close control sets the floor once the text column drops below it

Those rem based figures are the ones the authenticated application renders, where the root size follows the interface text setting and defaults to 14. The login page mounts its host outside that provider, so the icon renders at 18px and the detail at 13.71px there. The pixel based figures hold in both. Type covers the setting itself.

Motion ​

PhaseWrittenRendered
EnterOpacity and a half height translation over 300msThe opacity alone. The translation is applied through the translate property, which the transition does not name, so the message arrives in place
LeaveA 450ms height collapse with opacity and marginAll properties over 150ms. The durations are written inside the property list, which is not valid, so the list is dropped and the default duration applies

Motion carries the two durations the system does recognise.

What does not apply ​

WrittenEffect
class or style on the elementNone. Both are dropped by the attribute filter before the element underneath is reached
Content between the tagsNone. There is no default slot, and the element underneath reads five named templates
position on the elementNone. It is fixed to bottom-center inside the component
A pass-through on the elementNone. The component supplies its own
severity: "danger" on a messageNo background and no text colour, because the preset compares against error
A ripple on the close controlNone. The directive is attached and the setting that enables it is off
The theme rules that would pull the close control out of the boxNone. The preset is running unstyled, so no rule for them ships