Component Prop Guardrails
Make impossible prop combinations fail at the point of use rather than in production.
What it adds
Validation on shared component props that rejects contradictory or meaningless combinations as early as the codebase allows.
What your agent is told to do
5
What your agent is told to do
5-
1
Go through the shared components and write down which prop combinations are actually supported. Most components have grown two or three arrangements that were never intended and are held together by defensive branches inside the render.
-
2
Replace piles of independent booleans with a single named variant. A component taking a primary flag, a danger flag, and a ghost flag admits combinations nobody has ever designed, and each one has to be resolved arbitrarily at render time.
-
3
Express the same rule twice — once in the static type layer so it is caught while editing, and once as a runtime check so it is caught in tests and in development builds. The two must agree; a runtime check that permits something the types forbid is worse than neither.
-
4
In production the guardrail must report and degrade, never crash. Log the offending combination with the component name and pick a defined fallback rendering rather than throwing inside a render path.
-
5
Do not tighten a rule silently. Record what changed and what the supported replacement is, and hand removal of the old shape to the process described in Component Deprecation Path rather than deleting the prop in the same change.
Edge cases it handles
7
Edge cases it handles
7- Prefer one discriminated variant prop over several independent booleans, because a set of booleans multiplies into states that were never designed and forces the component to invent a precedence order at render time.
- The runtime validation and the static types must describe exactly the same rule. When they drift, developers trust the editor, tests pass against the looser check, and the invalid combination reaches users.
- A violation in production must warn and fall back rather than crash. A guardrail that throws inside a render turns a cosmetic mistake into a blank screen, which is a worse outcome than the wrong variant.
- Every tightened rule needs to be documented where the component is used, not only in its source, so callers who hit the new error know which shape replaced theirs.
- Warnings must be deduplicated per component and per combination, or a component rendered in a long list floods the console and the real message is lost.
- Props whose values come from server data or user configuration cannot be validated by types alone, so those paths need the runtime check and a defined behaviour for an unrecognised value.
- Validation must not run on every render of a hot component in production; the check belongs in development and test builds, with only cheap assertions left in place.
Definition of done
8
Definition of done
8- Contradictory prop combinations are rejected in the type layer and by an equivalent runtime check.
- Shared components expose named variants rather than overlapping boolean flags.
- An invalid combination in production logs a warning and renders a defined fallback instead of throwing.
- Repeated violations from the same component produce one warning, not one per render.
- Every tightened rule is documented at the point of use with its supported replacement.
- Props sourced from data outside the codebase have a defined behaviour for unrecognised values.
- 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.