Websites and web tools
Web Components: Red Flags and Green Flags
Web components are reusable custom HTML elements, such as a booking calendar, a vehicle photo gallery or a tire-size picker, built on browser standards rather than one framework. That portability makes them attractive for small business sites. It also means quality varies widely, so it pays to know what good and bad ones look like.
The building blocks in brief
- Custom elements: you define a new tag, whose name must contain a hyphen, such as
service-menu. - Shadow DOM: an isolated subtree whose styles do not leak out and page styles do not leak in, except through chosen hooks.
- Templates and slots: placeholders that let you pass your own content into the component.
Green flags
| Green flag | Why it matters |
|---|---|
| Works with plain HTML attributes and documented properties | You can configure it without a build step |
| Keyboard support and correct ARIA roles | Customers using keyboards or screen readers can book |
Styling hooks through CSS custom properties or ::part | You can match your brand without forking the code |
Fires standard events, such as change | Your own scripts can react to user choices |
| Renders something useful before JavaScript loads | The page is not blank on a slow connection |
| Clear licence and changelog | You know you can use it and what changed |
Red flags
| Red flag | Risk |
|---|---|
| Pulls in a large framework for a small widget | Slower pages and more code to update |
| Loads scripts or fonts from a third-party server at runtime | Privacy concerns and an outage you cannot control |
| Hard-coded colours and sizes with no styling hooks | It will never quite match your site |
| Click handlers on plain div elements instead of buttons | Broken for keyboard and assistive technology users |
| No tests and no recent releases | Bugs stay unfixed when browsers change |
| Asks you to paste its code inline without a version number | No way to track or roll back changes |
A ten-minute evaluation
- Read the documentation for attributes, properties, events and styling hooks.
- Load the demo and use it with only the keyboard: Tab, Enter, Space and the arrow keys.
- Turn on a screen reader briefly and listen to how controls are announced.
- Open the browser's network panel and note every file the component loads.
- Resize to phone width and check touch targets.
- Check the repository for the date of the last release and open issues.
Example: a booking date picker
Suppose you are choosing a date picker for a detailing booking page. A good one lets you disable Sundays and past dates through attributes, announces the selected date to screen readers, accepts typed dates as well as clicks, and fires a change event with an ISO date string such as 2026-05-14. A poor one only works with a mouse, stores dates in an ambiguous local format and pulls in a large library for one popup.
When to skip web components
If the native HTML element already does the job, such as a select for a short list of services or an input type="date" for simple forms, use it. Native elements come with keyboard support and mobile-friendly behaviour that a custom component has to rebuild.