Skip to content

Toast

VToast is a controlled low-level toast component. Queues, global APIs, and request integration belong in secondary wrappers.

Demo

Information updated
Saved successfully

Props

PropTypeDefaultDescription
visiblebooleanfalseVisibility
messagestring''Message text
type'text' | 'success' | 'warning' | 'danger' | 'loading''text'Toast type
position'top' | 'middle' | 'bottom''middle'Position
closeablebooleantrueShow close button
closeLabelstring'关闭通知'Accessible name for the close button

Motion and accessibility

Toast uses a 220ms entrance and 160ms exit transition with position-aware movement. Under prefers-reduced-motion: reduce, it falls back to an immediate opacity change. Success and neutral feedback use status; warnings and errors use alert.

Events

EventPayloadDescription
update:visiblebooleanVisibility updated
closevoidClosed