Overlay Coordination Layer
Give every menu, dialog, and drawer one set of rules for stacking, focus, and dismissal.
What it adds
A single layer owning stacking order, focus handling, background inertness, scroll locking, and dismissal for all floating surfaces.
What your agent is told to do
5
What your agent is told to do
5-
1
Inventory every floating surface the app already has — menus, popovers, tooltips, dialogs, drawers, backdrops, command palettes — and route each of them through the one layer rather than leaving each component to fend for itself.
-
2
Maintain an ordered stack of what is open. The topmost surface owns the Escape key and outside-click dismissal, and both must close exactly one level rather than everything at once.
-
3
Record the element that opened each surface, contain focus while it is open, and return focus to that element on close, including when the surface closes because a route changed.
-
4
Treat scroll locking and background inertness as counted resources held by the stack, released only when the last holder closes, so a nested dialog closing does not unlock the page beneath its parent.
-
5
Do not let components carry their own stacking constants. Assigning arbitrary depth values per component is exactly how a dropdown ends up behind the dialog that contains it, and the layer exists to remove that decision from every component.
Edge cases it handles
7
Edge cases it handles
7- Nested overlays must work in both directions — a menu opened inside a dialog, and a dialog opened from a menu. Closing the inner one must leave the outer one open, focused, and still locking scroll.
- Escape must be coordinated by the stack. If every open surface listens for it independently, one keystroke closes the tooltip, the menu, and the dialog together and the user loses unsaved work.
- Background content must be marked inert while a surface is open and unmarked exactly on close. Leaving the flag set makes the whole page unreadable to a screen reader; setting it on an ancestor of the overlay hides the overlay itself.
- A component that throws or unmounts while open must not leave the page permanently scroll-locked or focus-trapped. Register cleanup with the layer so an error path still releases the lock.
- A route change, a sign-out, or a session expiry while a surface is open must close the stack cleanly rather than leaving an orphaned backdrop over the new page.
- On mobile, the on-screen keyboard changes the usable height under a drawer or sheet, and dismissal by swipe must not conflict with scrolling the surface's own content.
- Where these surfaces are mounted in the document is owned by the Portal Host Registry brief; this brief decides ordering, focus, and dismissal, and must not also create its own mount points.
Definition of done
9
Definition of done
9- Every floating surface in the app is opened and closed through the one layer.
- Stacking order is derived from the open stack, and no component declares its own depth value.
- Escape and an outside click each dismiss exactly one level of the stack.
- Focus is contained while a surface is open and returned to the opening element on close, including on route change.
- Scroll lock and background inertness are released only when the last open surface closes.
- An error or unmount while a surface is open leaves the page scrollable and focusable.
- Mounting is delegated to the portal host registry rather than reimplemented.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Avatar Group
Avatar Group
Show who is involved in a compact space without a pile of broken images.
What it does
A stacked set of member avatars with deterministic ordering, an overflow count, and access to the full list.
How it works
- 1 Find the places that show several people at once — assignees, collaborators, workspace members, comment participants — and render them through one grouped component.
- 2 Order the stack deterministically by a stable rule such as role then name, so the same group renders in the same order on every load and every device.
- 3 Cap the number shown and collapse the remainder into a single count that is announced meaningfully, not as a bare number sitting after a row of pictures.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/avatar-group
Stepper Component
Stepper Component
Show people where they are in a multi-step flow and what is still ahead of them.
What it does
A single stepper used by every staged flow in the app, showing step order, completion, and errors.
How it works
- 1 Find every staged flow the app already has — onboarding, checkout, import wizards, multi-page settings — and render them all through one stepper rather than the three variants that have grown up separately.
- 2 Keep completion and navigation as two distinct concepts. A step can be complete without being current, and a step the user is allowed to jump back to is not the same as a step they have finished.
- 3 Model optional and skippable steps explicitly, and show a skipped step as skipped rather than as complete or as untouched. A user who skipped payment details needs to see that it is still outstanding.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/stepper-component
Dropdown Menu Primitive
Dropdown Menu Primitive
Give every action menu in the app the same keyboard, pointer, and dismissal behaviour.
What it does
A reusable menu primitive covering triggering, item navigation, selection, disabled items, and closing.
How it works
- 1 Find every action menu in the app — row overflow menus, account menus, bulk-action menus, toolbar menus — and rebuild them on one primitive so they stop behaving differently from each other.
- 2 Implement the full keyboard model: arrows move between items, Home and End jump to the ends, typing letters jumps to the matching item, Enter and Space activate, and Escape closes and returns focus to the trigger.
- 3 Close on outside pointer press, on Escape, and on the trigger being pressed again, and always return focus to the trigger so the user is not dropped at the top of the document.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/dropdown-menu-primitive
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.