Skip to content

Stop copy-pasting UI components into every project

Copy-pasted components drift, repeat the same bugs and never receive fixes. Here is why Vigour Components ships as a package you import, not code you copy.

Every team that builds more than one business app ends up with the same folder. It is called components, shared or ui, and it was copied from the last project. Then it was copied again. A year later there are four slightly different date pickers, three select boxes and a table that only one person understands.

Copying feels fast on day one. It is the slowest thing you can do on day three hundred.

What goes wrong when you copy components

Copied code stops being shared code the moment you paste it. From then on, every copy lives its own life.

  • Fixes do not travel. You fix a focus bug in the modal in project A. Projects B, C and D still have it, and nobody remembers to port the fix.
  • Behaviour drifts. One team adds a search box to their select. Another changes how "clear" works. Users who move between your apps feel the difference, even if they cannot name it.
  • Accessibility gets lost. Keyboard support, focus trapping and screen-reader labels are the first things to break in a hurried copy, because nobody sees them in a demo.
  • Upgrades become projects. When React, Next.js or your CSS tooling changes, every copy has to be updated by hand.
  • Nobody owns it. Shared code without an owner is not shared. It is abandoned in several places at once.

None of this is a skills problem. It is what happens when the only way to reuse a component is to duplicate it.

Import, don't copy

Vigour Components takes the opposite approach: the components live in versioned npm packages. You install them, wrap your app once and import what you need.

npm install @vigour-platforms/ui @vigour-platforms/tokens
import { VigourProvider, Select } from "@vigour-platforms/ui";

export default function Layout({ children }) {
  return <VigourProvider>{children}</VigourProvider>;
}

<Select label="Category" options={categories} value={category} onChange={setCategory} isSearchable />;

That is the whole setup. Every component works with sensible defaults, so the first screen takes minutes, not days.

When we fix a bug or improve keyboard support, you get it by updating one package version. Semantic versioning tells you whether an update is a safe patch, a new feature or a change that needs your attention, and the changelog tells you exactly what changed.

"But I need to change things"

This is the usual reason teams copy code: the library almost fits, so they take the source and edit it. Vigour Components is designed so you rarely need to do that.

You can change a component through props, theme tokens, class names on each internal part, render props, replaceable slot components and headless hooks that give you the logic with your own markup. We describe all eight levels in Customise React components without forking them.

The point is that each level keeps you on the upgrade path. You change what you need, and you still receive every fix.

When copying the source is the right call

Sometimes you really do need to own the code – a component so specific to your product that no option will ever cover it. For those cases, the open-source Core edition will include a command that copies one component's source into your project:

npx vigour add select

This is a deliberate, visible decision for one component, not the default for all of them. Everything you did not eject keeps updating normally.

One set of components, many apps

Vigour Components grew out of the screens we build for Vigour Platforms ERP: searchable selects, filter builders, data tables with saved views, dynamic forms, workflow timelines and printing. These are the parts every business app needs and every team rebuilds.

Packaging them means:

  1. Consistency for users. The same select behaves the same way in your HR app, your inventory app and your customer portal.
  2. Speed for developers. You spend your time on the business logic, not on the fifth version of a date picker.
  3. Quality that compounds. Every fix, test and accessibility improvement benefits every app at once.

What to do today

If your team already has a copied components folder, you do not need to throw it away. Start by noting which components you have copied more than twice, and which bugs you have fixed in more than one place. That list is the real cost of copy-paste.

Then take a look at the Vigour Components catalogue and the live demos, and install the free developer preview.