Ease-in
Also called ease in or acceleration curve
An easing curve that starts slowly and speeds up toward the end, like a car pulling away from a stop.
import { Toast } from '@base-ui/react/toast';
export function SaveButtonWithToast() {
return (
<Toast.Provider>
<SaveButton />
<Toast.Portal>
<Toast.Viewport className='fixed right-4 bottom-4 flex w-80 flex-col gap-2'>
<ToastList />
</Toast.Viewport>
</Toast.Portal>
</Toast.Provider>
);
}
function SaveButton() {
const toastManager = Toast.useToastManager();
return (
<button
type='button'
onClick={() =>
toastManager.add({
title: 'Changes saved',
description: 'Your project is up to date.'
})
}
className='rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground'
>
Save
</button>
);
}
function ToastList() {
const { toasts } = Toast.useToastManager();
return toasts.map((toast) => (
<Toast.Root
key={toast.id}
toast={toast}
swipeDirection='right'
// In with ease-out. Out with ease-in, cubic-bezier(0.55, 0, 1, 0.45):
// a slow start that gathers speed until it's gone.
className='flex items-start gap-3 rounded-xl border bg-background p-4 shadow-lg transition-[opacity,translate] duration-300 ease-out translate-x-(--toast-swipe-movement-x) data-starting-style:translate-y-2 data-starting-style:opacity-0 data-limited:hidden data-swiping:duration-0 data-ending-style:opacity-0 data-ending-style:duration-200 data-ending-style:ease-[cubic-bezier(0.55,0,1,0.45)] motion-safe:data-ending-style:translate-x-full'
>
<div className='flex-1'>
<Toast.Title className='text-sm font-medium' />
<Toast.Description className='text-sm text-muted-foreground' />
</div>
<Toast.Close
aria-label='Dismiss'
className='rounded-md px-1.5 text-muted-foreground hover:bg-muted'
>
×
</Toast.Close>
</Toast.Root>
));
}When a notification is dismissed, slide it fully off to the right and fade it out over 200ms with an ease-in curve, cubic-bezier(0.55, 0, 1, 0.45). Keep the opening animation on ease-out, and use a plain fade when prefers-reduced-motion is set.
Paste into Layerwise or any AI coding tool.
What is Ease-in?
Ease-in holds back at the start and saves most of the movement for the end, so the element accelerates and finishes at full speed. On a graph, the curve stays flat at first and then climbs steeply.
That slow start is why ease-in rarely suits interface responses. When someone clicks a button and the menu barely moves for the first part of the animation, the app feels laggy, even if the total duration is short. Menus, modals, and tooltips that open should use ease-out.
Ease-in works for elements leaving the screen for good, such as a dismissed notification sliding away: it gathers speed and is gone. Keep these exits short, around 150 to 250ms, because no one waits to watch something leave.
Often confused with
- Ease-out
- Ease-out is the mirror image: it starts fast and slows down at the end, so responses feel immediate.
Related terms
All termsEasing
A curve that controls how an animation’s speed changes over time, so motion can start slow, land softly, or keep one steady pace.
Ease-in-out
An easing curve that starts slowly, speeds up in the middle, and slows down again at the end, tracing an S shape on a graph.
Enter and exit animations
The pair of animations an element plays as it is added to the page and as it is removed, so changes to a list or layout are easy to follow.
Perceived performance
How fast an app feels to people, which skeleton screens, instant feedback, and progressive loading can improve even when the real wait stays the same.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.