04.03 · Micro-Interactions
Focus Ring Animation
A ring closes in around the item the Tab key reaches. Best for forms and menus.
Press Tab
Click the first field and press Tab to move through the form, or press Show me.
Inside, the dashed line is where the ring starts, faint, before it closes in around the item Tab reaches; the arrows show Tab's order. Press Tab, or press Show me.
No ring: Tab reaches Full name here too, but nothing shows it; With a ring: you can always see where Tab is. Press Tab through both forms, or Show me.
Try it
Change a setting, then try it again or press Show me.
Ring style
Glow adds a soft halo; Wide fills the gap with color.
Speed
How quickly the ring closes in around the item.
Ring thickness
Thicker rings are easier to spot.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add an animated focus ring to [the links, buttons and form fields on your page]. When keyboard focus moves to an item, draw an outline around it that starts a little further out and faint, then closes in to its place, so each Tab press is easy to follow. Show the ring only for keyboard focus, not after mouse clicks, and never remove the browser's focus outline without drawing this one instead. Make sure the ring stands out against every background it sits on. If the visitor has reduced motion turned on, show the ring at once without closing in. 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.