Kinetic Toast

A notification card with a tone icon that pops in, and a close button.

  • <kt-kinetic-toast>
  • Feedback
  • No framework

Kinetic Toast

The code

Copy the Kinetic Toast

Fastest: press Copy on the card above for one complete file. To build it into your own project, use the files below: the markup, the styles, this component’s script and the shared effects script (effects.js) that every component uses.

<kt-kinetic-toast title="Deploy Complete" message="Production build shipped in 2.4s." tone="success" sfx="ポン!"></kt-kinetic-toast>

<kt-kinetic-toast title="Rate Limit" message="82% of your monthly quota is used." tone="warning" sfx="ピピッ!"></kt-kinetic-toast>

Attributes

NameWhat it doesDefault
titleBold first line.—
messageSupporting text.—
tone"success", "warning", "error" or "info".info
sfxSound-effect text when it appears.—

Keyboard and screen readers

  • role="status" so screen readers announce it politely.
  • The close button is keyboard reachable.

Styling variables

Every look is a CSS variable: --kt-accent, --kt-accent-ink, --kt-radius-btn, --kt-surface-radius, --kt-surface-bg, --kt-border-w, --kt-comp-shadow and --font-sans. The copied file sets them all from your choices.

FAQ

Kinetic Toast: questions answered

How do I use the Kinetic Toast?

Press Copy on the card to get a complete HTML file, or copy the HTML, CSS and JavaScript tabs into your own page. In your markup the element is written as <kt-kinetic-toast>.

Which attributes does <kt-kinetic-toast> accept?

title, message, tone, sfx. Each one is described in the attributes table on this page.

Is the Kinetic Toast accessible?

role="status" so screen readers announce it politely. The close button is keyboard reachable.

Can I change the Kinetic Toast colors, corners and font?

Yes. Use the options on this page: accent color, border radius, background, border, shadow and Google font. The copied code already contains your choices, and every one of them is a CSS variable you can edit later.