KANTO DS v1.12.0
Customise

Theme

Accent

Font

Corners

Density

Text size

Reset to Kanto
Feedback

kt-toast

GitHub Copy link

A transient notification.

Preview

A transient notification.

For raising one, reach for toaster — this page is the element itself.

Usage

<kt-toast variant="warning" heading="Approaching your quota" dismissible duration="6000"></kt-toast>

heading, not title: every element already has a title, and shadowing it would turn the toast into its own tooltip.

Errors are role="alert" / aria-live="assertive" and interrupt the screen reader; everything else is role="status" / polite and waits its turn.

This is the only element in Kanto with a real shadow, and the only one that blurs what is behind it. A toast floats above the page, so it says so.

API

PropertyAttributeTypeDefault
variantvariant'success' | 'information' | 'warning' | 'error''information'
headingheadingstring''
descriptiondescriptionstring''
dismissibledismissiblebooleanfalse
durationdurationnumber (ms, 0 = stays)0
MethodDescription
close()Fires kt-toast-close
pause()Freezes the countdown
resume()Resumes it where it stopped
EventFired when
kt-toast-closeThe toast asks to be removed