Browse documentation
Reference / Transitions & animation
Slide animations
Slide a panel into or out of its resting position along the horizontal or vertical axis. Each preset travels one full element width or height.
Working example
Open the caption
The direction describes travel. Slide-in-up begins beneath the resting position, then moves the element upward.
<details class="group rounded border p-4">
<summary class="cursor-pointer font-semibold">Open the caption</summary>
<p class="mt-3 origin-left motion-safe:group-open:animate-slide-in-up">Plate IV · Folded paper study</p>
</details>Class reference
| Class | CSS declarations |
|---|---|
animate-slide-in-up | animation: mono-slide-in-up 300ms ease-out both; |
animate-slide-in-down | animation: mono-slide-in-down 300ms ease-out both; |
animate-slide-in-left | animation: mono-slide-in-left 300ms ease-out both; |
animate-slide-in-right | animation: mono-slide-in-right 300ms ease-out both; |
animate-slide-out-up | animation: mono-slide-out-up 300ms ease-in both; |
animate-slide-out-down | animation: mono-slide-out-down 300ms ease-in both; |
animate-slide-out-left | animation: mono-slide-out-left 300ms ease-in both; |
animate-slide-out-right | animation: mono-slide-out-right 300ms ease-in both; |
View full generated CSS
@keyframes mono-slide-in-down {
from {
transform: translateY(-100%);
}
to {
transform: translateY(0);
}
}
@keyframes mono-slide-in-left {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
@keyframes mono-slide-in-right {
from {
transform: translateX(-100%);
}
to {
transform: translateX(0);
}
}
@keyframes mono-slide-in-up {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@keyframes mono-slide-out-down {
from {
transform: translateY(0);
}
to {
transform: translateY(100%);
}
}
@keyframes mono-slide-out-left {
from {
transform: translateX(0);
}
to {
transform: translateX(-100%);
}
}
@keyframes mono-slide-out-right {
from {
transform: translateX(0);
}
to {
transform: translateX(100%);
}
}
@keyframes mono-slide-out-up {
from {
transform: translateY(0);
}
to {
transform: translateY(-100%);
}
}
.animate-slide-in-down {
animation: mono-slide-in-down 300ms ease-out both;
}
.animate-slide-in-left {
animation: mono-slide-in-left 300ms ease-out both;
}
.animate-slide-in-right {
animation: mono-slide-in-right 300ms ease-out both;
}
.animate-slide-in-up {
animation: mono-slide-in-up 300ms ease-out both;
}
.animate-slide-out-down {
animation: mono-slide-out-down 300ms ease-in both;
}
.animate-slide-out-left {
animation: mono-slide-out-left 300ms ease-in both;
}
.animate-slide-out-right {
animation: mono-slide-out-right 300ms ease-in both;
}
.animate-slide-out-up {
animation: mono-slide-out-up 300ms ease-in both;
}