Component Family Consistency
Every interactive component in a product — buttons, inputs, selects, checkboxes, radio buttons, pills, badges, tags, calendars, date pickers, sliders, toggles — belongs to the same visual family. They share a common design DNA. A user should be able to look at any component and feel that it belongs to the same product as every other component.
When components are designed in isolation without shared tokens, the product feels assembled from parts rather than built as a whole.
Reuse Before You Build a New Component
The rule, stated as directives:
Use existing components from the component library. Build a new one only after the audit below finds nothing that fits.
Do not invent a new visual presentation if a fitting component exists.
With every UI code change, check the changed files and their nearest sibling components for matching use cases, and keep them coherent. Report drift found elsewhere instead of fixing it unasked.
The goal is a UI that strictly follows the design system, with no ad-hoc components.
A native element is not a component. When the library has a Select, a bare <select> / <option> is the same defect as a third button radius — and it is the one agents produce by reflex. The same goes for <button>, <input type="date"> and <dialog> where a wrapper exists. Make the rule mechanical rather than remembered: a lint rule (no-restricted-syntax on the native JSX elements that have a library counterpart) stops it for humans and agents alike, and an agent that reads the error usually fixes it unprompted. Scope it to consumer code: the library's own components still render native elements, so exempt their directory with an override, and allow the native children a wrapper's API asks for, such as <option> inside a native-backed Select.
Before creating any component, audit what already exists — a new-from-scratch component is another mouth to feed: another entry in the family that must stay consistent (radius, height, states, motion) and another thing to maintain. Building fresh should be the last resort, not the first move. Work down this order:
- Is there already a component that does this? Use it as-is. If it almost fits, extend it with a prop or variant rather than cloning it — one flexible
ButtonbeatsPrimaryButton,BigButton, andCtaButtonliving in parallel. - Is there something close in the codebase you can generalise? Often a one-off was built inline for a single screen. If a small change would make it generic — lift it into the shared library, parameterise the hard-coded bits (label, colour, size via props/tokens), drop the screen-specific assumptions — do that instead of writing a second near-identical thing.
- Only build new when nothing existing fits and nothing can be reasonably generalised — and when you do, build it from the shared DNA below so it joins the family cleanly.
Parallel one-offs — three near-identical buttons, two cards with different radius — are how a design system drifts. Before adding a component, ask: does this exist, or is it one refactor from existing?
The inverse also holds: a visual treatment that appears independently in 2–3 places has earned promotion — name it and make it a shared component or token before a fourth copy appears. And when pages from different design eras disagree, migrate old toward new: the newest components are the best evidence of current intent, but confirm before deprecating a style — see