04.41 · Micro-Interactions
Dynamic Island
A black pill grows into a notification, then shrinks back. Best for live updates.
Click it
Click or tap the black pill to open it and again to close it, or press Show me.
Inside, the dashed box is the island and never changes size; the card waits inside at full size, and only a black cut-out grows to show it. Click the pill, or press Show me.
Just after a press, Appears at once shows the whole card; in Pill grows the black shape is still moving from the pill (dashed). Click the pill, or press Show me.
Try it
Change a setting, then try it again or press Show me.
Notification
What the pill grows into; pick another while it is open to see it change shape.
Speed
How quickly it grows and shrinks.
Bounce
How far it grows past its size before it settles.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a Dynamic Island style notification to [the top of your app or page]. At rest it is a small black pill; when [an event such as an incoming message] happens or the pill is pressed, it grows into a rounded card with the details, then shrinks back. Change the black shape with a clip or a scale, never by animating its width or height, so the text inside never stretches and nothing around it moves. Keep the details inside the shape, fading them in once it has room. Make the pill a real button for taps, clicks and the keyboard, and announce its message politely to screen readers. If the visitor has reduced motion turned on, crossfade the pill and the card instead. 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.