Web development

Why reinvent the wheel when it’s already built in?

In his article, Chris Burnell describes a developer who spent two days writing his own colour picker. A custom canvas, custom logic for RGB/HEX conversion, custom drag controls for the colour wheel. It looked great. The problem was that the browser can do the same thing in a single line:

<input type="color">

And it is not a one-off. It is more of a pattern that keeps repeating in IT — and not only in IT.

A screwdriver someone made from scratch

Imagine a craftsman who, instead of reaching into his toolbox for a screwdriver, starts by making one. He carves a handle, grinds the tip, hardens it. Three days later he has a working screwdriver. The workshop next door has had one for twenty years, hanging on the wall, ready to grab.

It sounds absurd. Yet exactly the same thing happens all the time in web development. Instead of reaching for something the browser already has built in, we start building it from scratch — with our own JavaScript, our own CSS and our own edge-case bugs that then take months to fix.

What the browser already has “built in”

A collapsible section. Instead of a custom accordion component with JS listeners:

<details>
  <summary>More information</summary>
  <p>Content shown on click.</p>
</details>

It works straight away, including keyboard navigation you would otherwise have to add by hand.

A slider. Instead of a custom draggable element that calculates the mouse position:

<input type="range" min="0" max="100">

Date and time. Instead of downloading a library that adds tens of kilobytes to the bundle:

<input type="date">

On mobile, it also opens the native calendar the user knows from their phone — not a web widget that feels foreign to them.

A modal window. Instead of a modal framework just for one popup:

<dialog id="modal">
  <p>Dialog content</p>
</dialog>

Editable text. The foundation that tools like Notion are built on:

<div contenteditable="true">Click and type.</div>

Why it pays off

It is not just about saving time. The screwdriver from the workshop has another advantage — it has been tested by thousands of people, refined over years, and sits in the hand exactly as it should. The same is true of native HTML elements:

  • They work with screen readers without you having to fine-tune ARIA attributes.
  • They add no dependency that needs updating over time because of security holes.
  • They look and behave “at home” on every device — exactly as the user knows them from other apps.

When your own wheel does pay off

A ready-made solution is not always the right one. If you need a precisely defined slider design across all browsers, the native <input type="range"> will limit your styling. If you target older versions of Safari, some newer elements such as <dialog> can cause problems. And complex logic — validation, linked fields, animations — HTML will never solve on its own; that is what JavaScript is for.

So the question is not “should this be hand-built or not?”. The question is: did I first check what I already have built in?

Just like with the screwdriver — sometimes your own version is worth it, because you need a very specific shape. But that should be a conscious decision, not the result of never looking at what is hanging on the wall.

Inspired by the article HTML Can Do That by Chris Burnell.

Categories:Web development

Meeting

Let’s talk about your project.

Online, or in person in Slovakia. We go through what you need, and I recommend a solution and the options for building it.

Book a meeting +421 944 933 738

The consultation is free and without obligation.