Focus Containment Primitive
Keep keyboard focus inside an open overlay and return it where it started.
What it adds
A shared containment primitive that moves focus into an overlay, cycles it within, and restores it on close.
What your agent is told to do
5
What your agent is told to do
5-
1
Find every overlay that takes over the screen — dialogs, drawers, command palettes, mobile navigation — and give all of them the same containment behaviour rather than each implementing its own.
-
2
Record the element that had focus before the overlay opened, move focus to a sensible starting point inside it, and return focus to the recorded element when it closes.
-
3
Recompute the set of focusable elements at the moment focus moves, not once when the overlay opens. Overlay content changes as fields appear, sections expand, and content loads.
-
4
Track containment as a stack so a confirmation opened from a dialog contains focus to itself and hands containment back to its parent when dismissed.
-
5
Do not hide the rest of the page from assistive technology by removing it from the accessibility tree and then forget to reverse it. A stale hidden state leaves the whole application silent to a screen reader after the overlay closes.
Edge cases it handles
7
Edge cases it handles
7- The focusable elements inside an overlay change while it is open — asynchronously loaded content, conditionally rendered fields, a disabled submit that becomes enabled. Query the set live rather than caching a list captured at open time.
- Overlays open other overlays. Containment must nest, so the innermost overlay holds focus and closing it restores containment to the one beneath rather than to the page.
- Screen reader users navigate with virtual cursors and gestures that are not tab presses, and a containment that fights those tools traps them. Keep Escape working, keep the close control reachable, and do not attempt to intercept every mode of navigation.
- The element that had focus before the overlay opened may be gone by the time it closes — the row was deleted, the list re-rendered, the trigger was itself inside the overlay. Fall back to a stable nearby container so focus never lands on the document body.
- An overlay with no focusable content at all still needs a target, otherwise focus stays behind it and every keystroke goes to the page underneath.
- Containment must not swallow browser-level shortcuts or prevent the user reaching the address bar; contain focus within the document, not within the browser.
- Content inside the overlay rendered elsewhere in the DOM — a menu or popover portalled to the document — is visually inside but structurally outside. Treat it as part of the contained region or focus will escape whenever such a control opens.
Definition of done
9
Definition of done
9- Tab and Shift-Tab cycle only within the open overlay and never reach the page behind it.
- Focus moves into the overlay on open and returns to the triggering element on close.
- Focusable content added or removed while the overlay is open is included in the cycle immediately.
- Nested overlays contain focus independently and hand containment back in order.
- Escape and the visible close control both work in every overlay using the primitive.
- A missing or removed trigger results in focus landing on a defined fallback, never on the document body.
- The rest of the page is hidden from assistive technology only while an overlay is open, and is exposed again afterwards.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Screen Reader Only Utility
Screen Reader Only Utility
One tested way to add text for assistive technology without it appearing on screen.
What it does
A single visually hidden utility used for labels, instructions, and context that assistive technology needs and sighted users do not.
How it works
- 1 Find every place the app currently hides text from sight — off-screen positioning, zero dimensions, transparent colour, tiny font sizes, aria-label strings duplicating nearby copy — and consolidate them onto one utility.
- 2 Build it by clipping the element to nothing while keeping it rendered and in the accessibility tree: it must occupy no visual space and contribute nothing to layout, yet still be read in document order.
- 3 Provide a second variant that becomes visible when it receives focus, and use it for skip links and any other hidden content that is itself focusable.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/screen-reader-only-utility
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
Progress Indicator System
Progress Indicator System
Tell people how far along the work is, in the same way every time.
What it does
A consistent set of bars, rings, step trackers, and accompanying text for work that takes measurable time.
How it works
- 1 Identify every operation in the app that takes long enough to need feedback — uploads, imports, exports, batch actions, multi-step flows — and decide for each whether its progress is genuinely measurable.
- 2 Use a determinate form only when a real proportion is known. Where the total is unknown, use an indeterminate form and say what is happening in words rather than inventing a percentage.
- 3 Pair every indicator with text that names the operation and its current position, so the information survives for someone who cannot see the graphic.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/progress-indicator-system
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.