03.09 · Page Transitions
Elastic Transition
The new page slides in, goes too far and springs back. Best for playful apps.
Click it
Click Work or About at the top of the box, or press Show me.
Inside, the graph traces the new page's place over time: it comes in from the side, goes past its place, springs back and settles. Click Work or About, or press Show me.
Stops dead slides the new page in and stops at its place; Springs back goes a little past and bounces back before settling. Click Work or About, or press Show me.
Try it
Change a setting, then try it again or press Show me.
How it bounces
A planned path is cheap; a live spring feels more physical.
Bounce size
How far the page goes past its place before settling.
Speed
How quickly the page springs into place.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add an elastic transition to [the pages or panels you want to move between]. The new page should slide in from the side, go a little past its place and spring back before settling, as if pulled by a rubber band, while the old page slides away. The bounce can be planned ahead as a fixed path, which is cheap, or worked out live with a simple spring, which can react if the visitor interrupts it; with a live spring, advance it in small fixed time steps so it moves the same on every screen, and limit the time one frame adds so a slow frame cannot throw it off. If the visitor has reduced motion turned on, switch pages without movement. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.