04.17 · Micro-Interactions
Drawer / Panel Slide
A side panel slides in over a dimmed page. Best for mobile menus.
Click it
Press the menu button, then close the drawer with × or a swipe, or press Show me.
Inside, the drawer waits just off the screen, outlined where it parks; opening slides it in over the page, slowing as it lands. Press the menu button, or Show me.
Appears at once: the menu is simply there; Slides in: it comes in from the edge, so you see where it lives. Press the menu button, or Show me.
Try it
Change a setting, then try it again or press Show me.
Slides in from
The edge the drawer comes in from.
Opening speed
It slows down as it arrives, like a panel landing.
Closing speed
It speeds up as it leaves, so closing feels quick.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a slide-in drawer to [the menu or panel you want to open]. It waits just beyond one edge of the screen and slides in over the page when its button is pressed; when the settings include it, the page behind it dims. Let it slow down as it arrives, like a panel sliding to a stop, and speed up as it leaves, so closing feels quicker than opening. Close it with a close button, a tap on the page beside it, the Escape key or a swipe back toward its edge. Move only its position, and keep keyboard focus inside it while it is open. If the visitor has reduced motion turned on, show and hide it without sliding. 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.