# Toast Notification

> A compact success toast that slides up and fades in when it appears.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: toast, notification, snackbar, slide, alert
- Live preview: https://copy-css.com/snippets/toast-slide-in
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="toast-ok" role="status">
  <span aria-hidden="true">✓</span>
  Changes saved
</div>
```

## CSS

```css
.toast-ok {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 12px;
  border-radius: 12px;
  background: #18181b;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
  color: #fafafa;
  font: 500 14px/1 system-ui, sans-serif;
  animation: toast-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.toast-ok span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
}

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

## Notes

- This CSS Toast Notification is 31 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
