Overlays

Toast Notification Slide In

A toast that slides in from the right with a soft overshoot.

Changes saved

Supporting copy goes here.

Edit this in the studio

Opens with this animation loaded. Nothing is uploaded — the scene travels in the link.

animation.css
.toast {
  transform: translate3d(120px, 124px, 0);
  box-shadow: 0px 10px 30px 0px #00000070;
  width: 240px;
  height: 72px;
  background: #1c1e2a;
  border-radius: 14px;
  color: #e7e9ee;
  font-size: 13px;
  animation: toast-anim 1200ms linear 0ms infinite both;
  will-change: transform, opacity;
}

@keyframes toast-anim {
  0% {
    transform: translate3d(420px, 124px, 0);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  17.33% {
    transform: translate3d(111.292px, 124px, 0);
    opacity: 1;
  }
  43.33% {
    transform: translate3d(120px, 124px, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(120px, 124px, 0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
    transition: none;
  }
}

Why it is built this way

A back-out easing overshoots a few pixels and settles, which reads as the toast arriving rather than being placed. Fade the opacity in faster than the slide so it is never a solid block skidding across the screen.

What it animates

2 properties across 2 CSS declarations. The bar shows when each one is moving.

Opacity
opacity
0 1
3 stopscompositor
X
transform
300 0px
2 stopscompositor

What it costs to run

Opacity and x are handled by the compositor: no layout, no repaint, and the work can run off the main thread. This is the cheap end of CSS animation, which is why it stays smooth on a slow phone where other properties will not.

It runs for 1.20s across 5 keyframe stops, with every property moving over the same window.

3 curves in play — Back Out, Ease Out and Linear on a card. Different properties easing differently is how a movement gets texture: the eye reads the mismatch as weight rather than as a mistake.

Accessibility

Starting at opacity 0 makes the reduced-motion guard load-bearing rather than polite: strip it and a reader who asked for less movement gets no content at all, because nothing ever fades it in. It fades over 1.20s alongside x, and the guard skips all of it together. The generated CSS ends on the resting state, so skipping straight there is safe.

Related animations

toastnotificationslidesnackbar